Replies: 2 comments
-
I went ahead and converted this over to an issue at #4564. This doesn't mean it will be done or that it will be done exactly as listed here but I would like higher visibility for any discussions on this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tl;dr a nice feature for numbers would allow reading passed argument as differing radix among the traditional hexadecimal, decimal, octal, and binary.
I have implemented this here. It's a good bit of work. Would be nice if
clap
handled this for me. I'm imagining an option likeallow_radix_all
And perhaps, further fine-grained options would also be allowed:
allow_radix_hexadecimal
,allow_radix_octal
,allow_radix_binary
. Soallow_radix_all
would just enable all the prior.And might even want to throw in
disallow_radix_decimal
for some users that really want such.Parsing could require a prepended
0
before the radix symbol, e.g.0xF
,0d15
,0o17
,0b1111
and reject without, e.g.xF
,d15
,o17
,b1111
. or could be flexible and accept both. I'm not sure what is best there.Beta Was this translation helpful? Give feedback.
All reactions