Skip to content

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

Open
@octogonz

Description

@octogonz

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.

Metadata

Metadata

Assignees

Labels

effort: difficultProbably not a quick fix... got the skills?

Type

No type

Projects

Status

Needs triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions