Closed selfup closed 5 years ago
As discussed @sharkdp I have added --c
and -c
and ensured the values are hidden.
We could always change --c
to --count
which seems like a viable alias for --length
in this context.
However this is the path of least resistance! 🙏
Let me know what you think
Here is a screeny:
Ok changed --c
to --bytes
with a short of -c
.
Still hidden from list of commands (maybe it can be shown now that it has valuable meaning?)
--length
/-n
/-bytes
/-c
all behave the same now
Awesome, thank you very much.
Still hidden from list of commands (maybe it can be shown now that it has valuable meaning?)
Sorry. Only saw that after merging.
Yes, we could also make it visible and have the help text say something like "An alias for -n/--length".
You are very welcome!
Now I'll go make a new PR to make it visible.
c alias for length and -n
References #46
Usage
Caveats
So this is interesting. There doesn't seem to be a way to pass in multiple shortnames.
You also can't define the same
Arg::with_name("same_name")
twice.potentially seeing if clap would be OK with adding or getting a PR for multiple shortnames would be another option as well
So the closest thing I could get was adding an alias which still means
--
instead of-
.Now one thing that could be done would be to add a new Arg block but that feels repetitive?
https://docs.rs/clap/2.20.0/clap/struct.Arg.html#short
If adding a new
--c
/-c
The diff would look like (from current commit in PR)