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

pro <valid command> <--invalid flag> gives usage for the pro parser #3239

Open
github-actions bot opened this issue Jul 30, 2024 · 1 comment
Open
Labels
bug something isn't working triaged

Comments

@github-actions
Copy link

This issue was created from a comment in Pull Request #3206.

@renanrodrigo
Copy link
Member

Description of the bug

In the client we build the whole argparse structure, and do a single parse_args with what is provided in the CLI.

When we removed the customized usage strings from the Client argparse, this particular situation started - when an invalid option is passed, the main pro usage is show in the error message (as this is the parser that is recognizing the wrong option) even when a subcommand is present.

Subcommands have their own parsers and usages, and they should match what we see when a typo happens for instance.

Expected behavior

user@ubuntu-machine:~$ pro config --lolwrong
usage: pro config [-h] {show,set,unset} ...
pro: error: unrecognized arguments: --lolwrong

Current behavior

user@ubuntu-machine:~$ pro config --lolwrong
usage: pro [-h] [--debug] [--version] <command> ...
pro: error: unrecognized arguments: --lolwrong

To Reproduce

Build from the development branch, check scenarios above.

System information:

  • Ubuntu release: all supported
  • Pro Client version: development, TBR after 32.2.

@orndorffgrant orndorffgrant added bug something isn't working triaged labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants