From cf8602fe15b9205a8fa06b94ef2bd6d543e2018e Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:45:15 +0900 Subject: [PATCH] ptx: report that -g/-w negatve_num as invalid --- src/uu/ptx/src/ptx.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/uu/ptx/src/ptx.rs b/src/uu/ptx/src/ptx.rs index 759ddd2fdf5..d7a5755d4cd 100644 --- a/src/uu/ptx/src/ptx.rs +++ b/src/uu/ptx/src/ptx.rs @@ -1041,6 +1041,8 @@ pub fn uu_app() -> Command { Arg::new(options::GAP_SIZE) .short('g') .long(options::GAP_SIZE) + // report -NUM as invalid value + .allow_hyphen_values(true) .value_parser(value_parser!(u64).range(1..)) .help(translate!("ptx-help-gap-size")) .value_name("NUMBER"), @@ -1082,6 +1084,8 @@ pub fn uu_app() -> Command { Arg::new(options::WIDTH) .short('w') .long(options::WIDTH) + // report -NUM as invalid value + .allow_hyphen_values(true) .value_parser(value_parser!(u64).range(1..)) .help(translate!("ptx-help-width")) .value_name("NUMBER"),