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

How to disable default Global Arguments (especially -o)? #246

Open
dylanwa opened this issue Apr 27, 2021 · 0 comments
Open

How to disable default Global Arguments (especially -o)? #246

dylanwa opened this issue Apr 27, 2021 · 0 comments

Comments

@dylanwa
Copy link

dylanwa commented Apr 27, 2021

I have a command accepting argument --output-path, and I set its options_list also accept "-o", but it does not work, conflict with the default global argument. It means we can't use --output and -o for our commands.

Question:

  1. How to disable Global Arguments, at least for "--output", "-o", or even "--query"?

More details:
with ArgumentsContext(self, "config fetch") as arg_context:
arg_context.argument("output", type=str, options_list=("-o", "--output-path"))

When I tried it, it reports conflict error:
$ mycli config fetch -o test.json
argument -o/--output-path: conflicting option string: -o

and only this option works:
$ mycli config fetch --output-path test.json

$ mycli config fetch -h

Command
mycli config fetch

Arguments
--output-path : Default: my_config.json.

Global Arguments
--debug : Increase logging verbosity to show all debug logs.
--help -h : Show this help message and exit.
--only-show-errors : Only show errors, suppressing warnings.
--output -o : Output format. Allowed values: json, jsonc, none, table, tsv, yaml, yamlc.
Default: json.
--query : JMESPath query string. See http://jmespath.org/ for more information and
examples.
--verbose : Increase logging verbosity. Use --debug for full debug logs.

@dylanwa dylanwa changed the title How to disable Global Arguments? How to disable default Global Arguments (epically -o)? Apr 27, 2021
@dylanwa dylanwa changed the title How to disable default Global Arguments (epically -o)? How to disable default Global Arguments (especially -o)? Apr 27, 2021
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

No branches or pull requests

1 participant