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

Fix --only-show-errors on root parser #253

Merged
merged 2 commits into from Nov 16, 2021
Merged

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented Nov 12, 2021

--only-show-errors doesn't work on root parser:

> python .\examples\exapp2 --only-show-errors
usage: exapp2 [-h] [--verbose] [--debug] [--only-show-errors] [--output {json,jsonc,yaml,yamlc,table,tsv,none}]
              [--query JMESPATH]
              {hello,sample-json,sample-logger,abc,ga,pre,exp,dep,demo} ...
exapp2: error: the following arguments are required: _command

This is due to a typo made by #179. Now fix it.

@jiasli jiasli requested a review from kairu-ms November 12, 2021 06:42
@jiasli jiasli requested a review from yonzhan November 12, 2021 08:05
@@ -137,7 +137,7 @@ def execute(self, args):
self.parser.load_command_table(self.commands_loader)
self.cli_ctx.raise_event(EVENT_INVOKER_CMD_TBL_LOADED, parser=self.parser)

arg_check = [a for a in args if a not in ['--verbose', '--debug', '--only-show-warnings']]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

None yet

2 participants