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

[ts-command-line] The argparse library allows arbitrary abbreviations, which causes confusion #790

Open
octogonz opened this issue Aug 28, 2018 · 0 comments
Assignees
Labels
effort: difficult Probably not a quick fix... got the skills?

Comments

@octogonz
Copy link
Collaborator

Someone was recently asked to type this command:

rush --debug update -p --full

...but they accidentally typed this:

rush update -p --full --debug

Expected: According to the design of ts-command-line, this should have reported an error, since --debug is a global option, NOT an option of the rush update subcommand.

What actually happens: Instead, the command silently succeeds, but confusingly behaves as if this was typed:

rush update -p --full --debug-package-manager

The reason is that argparse has an obscure feature that allows any option to be shortened (e.g. --debug-pac instead of --debug-package-manager), as long as it doesn't cause ambiguity. But this convenience only looks for ambiguity within a single parser block.

@octogonz octogonz added the effort: difficult Probably not a quick fix... got the skills? label Sep 14, 2018
@halfnibble halfnibble self-assigned this Jun 21, 2019
@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: difficult Probably not a quick fix... got the skills?
Projects
Status: Needs triage
Development

No branches or pull requests

2 participants