From dc4035e6fbcdf6b4a2e7563b962c1ac2c40f4904 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:36:32 +0900 Subject: [PATCH] nl: show allowed range when -i/-l negative_num is given --- src/uu/nl/src/nl.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/uu/nl/src/nl.rs b/src/uu/nl/src/nl.rs index c94a684c168..b94d1646eb4 100644 --- a/src/uu/nl/src/nl.rs +++ b/src/uu/nl/src/nl.rs @@ -329,7 +329,9 @@ pub fn uu_app() -> Command { .long(options::LINE_INCREMENT) .help(translate!("nl-help-line-increment")) .value_name("NUMBER") - .value_parser(clap::value_parser!(i64)), + // show range of allowed value when -NUM is passed + .allow_hyphen_values(true) + .value_parser(clap::value_parser!(i64).range(0..)), ) .arg( Arg::new(options::JOIN_BLANK_LINES) @@ -337,6 +339,8 @@ pub fn uu_app() -> Command { .long(options::JOIN_BLANK_LINES) .help(translate!("nl-help-join-blank-lines")) .value_name("NUMBER") + // show range of allowed value when -NUM is passed + .allow_hyphen_values(true) .value_parser(clap::value_parser!(u64)), ) .arg(