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

Support options with only a short flag #1249

Closed
shadowspawn opened this issue Apr 18, 2020 · 1 comment
Closed

Support options with only a short flag #1249

shadowspawn opened this issue Apr 18, 2020 · 1 comment
Assignees
Milestone

Comments

@shadowspawn
Copy link
Collaborator

Commander originally expected there would always be both short and long flags for each option. Support got added for long-only (#18).

Things almost work if you do try defining only a short flag, but by accident, and the value for -a ends up getting stored for A.

.option(`-d`, `debug`)

(The simple work-around is to add a long flag, so this may not be much of an issue in practice as has not been raised in issues here. It did get mentioned as a minor annoyance in a good comparison article in 2018: https://pantas.net/node_argument_parsers/ )

@shadowspawn shadowspawn self-assigned this May 2, 2020
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Jun 1, 2020
@shadowspawn shadowspawn added this to the v6.0.0 milestone Jun 20, 2020
@shadowspawn
Copy link
Collaborator Author

Released with Commander v6.0.0 : https://github.com/tj/commander.js/releases/tag/v6.0.0

@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Jul 19, 2020
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

1 participant