Skip to content

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

Merged
Jiashuo Li (jiasli) merged 2 commits into
microsoft:devfrom
jiasli:only-show-errors
Nov 16, 2021
Merged

Jiashuo Li (jiasli) merged 2 commits into
microsoft:devfrom
jiasli:only-show-errors

Conversation

@jiasli

Copy link
Copy Markdown
Contributor

--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.

Comment thread knack/invocation.py
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']]

Copy link
Copy Markdown

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.

2 participants