Add alias '-l' for '-n/--length'

Set `.hidden(true)` option

This won't clutter the help text too much.
This commit is contained in:
TheDoctor314 authored and David Peter committed 2021-07-11 19:57:55 +02:00
1 parent 06387bba3e
commit 19d2805729
1 file changed
+9
+9
View File
@@ -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",