-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number as option alias not working as advertised #1454
Comments
@madflow Did you try setting the yargs.parserConfiguration({
"parse-numbers": false
}) |
No, it does not work either. |
do we want to support numbers as options, is a question worth asking ... this feels a little weird. |
@bcoe I am not sure at whom this question is directed - but since I logged this issue: It is weird and felt nonintuitive in our "downstream" application. We removed the number alias. |
@bcoe I also fell its weird (but maybe some people use it?) However, if we decide we do support numbers as options, shouldn'd we explicitely not support it (ie throw when a number is passed as a key or an alias, and stop parsing |
I don't think numeric CLI flags are weird; quite a few of the standard unixy tools use numeric CLI flags. I'm sure many of us have used grep
gzip
ssh
rsync
xargs
|
Is it enough that we document the option as
|
Is there a precedent for |
@benjie the tool I had in mind was |
Closed by #1493 |
As discussed on yargs/yargs#1454 even though there are plenty of valid usecases for single-digit aliases and many well stablished examples, it is still completely unsupported on yargs-parser. This changeset introduces the possibility of using this simple numeric alias in the context of boolean flags.
Hello!
When using a number as alias - it is advertised in the
help
section as-1
- but this does not work. (The option stays undefined).The text was updated successfully, but these errors were encountered: