mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 10:16:14 +01:00
Merge pull request #1149 from dmach/fix-argparse-conflicts
Do not traceback on conflicting argparse arguments
This commit is contained in:
commit
1115cb4b9e
@ -174,7 +174,10 @@ class Cmdln:
|
|||||||
# add hidden copy of global options so they can be used in any place
|
# add hidden copy of global options so they can be used in any place
|
||||||
self.add_global_options(subparser, suppress=True)
|
self.add_global_options(subparser, suppress=True)
|
||||||
for option_args, option_kwargs in options:
|
for option_args, option_kwargs in options:
|
||||||
subparser.add_argument(*option_args, **option_kwargs)
|
try:
|
||||||
|
subparser.add_argument(*option_args, **option_kwargs)
|
||||||
|
except argparse.ArgumentError as e:
|
||||||
|
print(f"WARNING: Could not add argument '{e.argument_name}' to the '{cmd_name}' sub-command: {e}", file=sys.stderr)
|
||||||
|
|
||||||
def argparse_error(self, *args, **kwargs):
|
def argparse_error(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user