Skip to content
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

Flag alias with number not working #89

Closed
torifat opened this issue Jun 15, 2018 · 5 comments
Closed

Flag alias with number not working #89

torifat opened this issue Jun 15, 2018 · 5 comments

Comments

@torifat
Copy link

torifat commented Jun 15, 2018

I want to support the following flag:

--stage-0, -0

But, -0 doesn't work. --0 is working. Is it by design? If it's not then I can raise a PR. Thanks for the awesome project ❤️

@sindresorhus
Copy link
Owner

Just an oversight. PR welcome :)

@torifat
Copy link
Author

torifat commented Jun 15, 2018

It turns out that the problem is with yargs-parser.

I/O with non-number alias

{ minimistoptions:
   { string: [ '_' ],
     boolean: [ 'zero' ],
     alias: { x: 'zero' },
     default: { zero: false } } }
{ argv: { _: [], zero: true, x: true } }

I/O with number alias

{ minimistoptions:
   { string: [ '_' ],
     boolean: [ 'zero' ],
     alias: { '0': 'zero' },
     default: { zero: false } } }
{ argv: { '0': false, _: [ '-0' ], zero: false } }

@sindresorhus
Copy link
Owner

Can you open an issue on yargs-parser about the problem?

@torifat
Copy link
Author

torifat commented Oct 17, 2018

Can you open an issue on yargs-parser about the problem?

Done

@torifat
Copy link
Author

torifat commented Oct 18, 2018

Seems like it wasn't a mistake -> yargs/yargs-parser#44

@torifat torifat closed this as completed Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants