mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-30 09:05:54 +00:00
Add alias '-l' for '-n/--length'
Set `.hidden(true)` option This won't clutter the help text too much.
This commit is contained in:
1 parent
06387bba3e
commit
19d2805729
1 file changed
+9
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user