Closed FauxFaux closed 5 years ago
I used -n
for --length
because that is used in hexdump
. I'm okay with adding an additional alias -c
.
I made a small PR, but multiple shortnames does not seem to be an option for clap
.
I made some suggestions, but otherwise --c
would be the easiest compromise 🙏
@selfup Thanks for looking into this. That's a pitty. Maybe this is something that should be requested in clap
.
I made some suggestions, but otherwise
--c
would be the easiest compromise
I'm not a big fan of adding --c
, to be honest. Long --
options should be used for descriptive names.
There is a possibility to hide options in clap
, so I guess we could go with your other idea and just add a second option which could be hidden.
Yea hiding the --c
so we can get a -c
would be interesting. If I have time I'll see what can be done about an upstream to clap. Otherwise I will attempt to hide the long "fakename"
We could also have a longname like "count"
that would be a viable longname
All I would need to do is: hidden(true);
in the Arg definition for long("c")
Let me know if hiding works for now until a change in clap can be made/suggested with approval
Ok updated my PR: https://github.com/sharkdp/hexyl/pull/48#issuecomment-460449756
🎉
Let me know if those PRs resolved the issue @FauxFaux :smile:
hexyl -n 100
is, in my mind, replacinghead -c 100 | xxd
. If it is directly replacingxxd
,xxd
calls this option-l
(length
, which I had to look up, because I usehead
).Please support
-c
, with the same behaviour as the current-n
, and/or improve the error output to remind users of the correct option:Annoyingly,
xxd
uses-c
forcols
.