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

"?" alias ignored #23

Open
stevenvachon opened this issue May 14, 2017 · 2 comments
Open

"?" alias ignored #23

stevenvachon opened this issue May 14, 2017 · 2 comments

Comments

@stevenvachon
Copy link

const options = require('optionator')({
  options: [{
    option: 'help',
    alias: '?',
    type: 'Boolean'
  }]
}).parse('-?');

console.log(options);
//-> { _: [ '-?' ] }
@gkz
Copy link
Owner

gkz commented May 15, 2017

When we parse options, we assume the option name passes the regex:

[a-zA-Z][-a-zA-Z0-9]*

We can maybe expand this to cover more cases.

@stevenvachon
Copy link
Author

I've seen a number of Windows/DOS commands that use -? for accessing the help screen, so it'd be a nice enhancement.

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