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

Transform duplicated short flag to upper case #55

Merged
merged 2 commits into from
Feb 5, 2017
Merged

Conversation

ntwcklng
Copy link
Collaborator

@ntwcklng ntwcklng commented Feb 5, 2017

If you specify two options with the same first letter, the second one gets transformed to uppercase by default.

example.js:

#!/usr/bin/env node

const args = require('./')

args
  .option('debug', 'Run Debug mode')
  .option('deploy', 'Deploy')

const flags = args.parse(process.argv)

$ node example.js help:

  Usage: example.js [options] [command]
  
  Commands:
  
    help  Display help
  
  Options:
  
    -d, --debug    Run Debug mode
    -D, --deploy   Deploy
    -h, --help     Output usage information
    -v, --version  Output the version number

Note that the --deploy short-flag is now capitalized

@leo leo merged commit a97d055 into leo:master Feb 5, 2017
@ntwcklng ntwcklng mentioned this pull request Feb 10, 2017
@leo
Copy link
Owner

leo commented Feb 10, 2017

Released!

leo pushed a commit that referenced this pull request May 1, 2022
* transform duplicated short flag to upper case

* add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants