From 19d2805729e6cabc34c916045056490e2c987233 Mon Sep 17 00:00:00 2001 From: TheDoctor314 Date: Fri, 2 Jul 2021 19:34:06 +0530 Subject: [PATCH] Add alias '-l' for '-n/--length' Set `.hidden(true)` option This won't clutter the help text too much. --- src/bin/hexyl.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bin/hexyl.rs b/src/bin/hexyl.rs index 71a9999..b161d22 100644 --- a/src/bin/hexyl.rs +++ b/src/bin/hexyl.rs @@ -49,6 +49,14 @@ fn run() -> Result<(), AnyhowError> { .conflicts_with("length") .help("An alias for -n/--length"), ) + .arg( + Arg::with_name("count") + .short("l") + .takes_value(true) + .value_name("N") + .hidden(true) + .help("Yet another alias for -n/--length"), + ) .arg( Arg::with_name("skip") .short("s") @@ -177,6 +185,7 @@ fn run() -> Result<(), AnyhowError> { let mut reader = if let Some(length) = matches .value_of("length") .or_else(|| matches.value_of("bytes")) + .or_else(|| matches.value_of("count")) .map(|s| { parse_byte_count(s).context(anyhow!( "failed to parse `--length` arg {:?} as byte count",