qvm-template: allow global arguments after action name
It's convenient to use for example `qvm-template list --enablerepo=*-testing` Previously, _some_ options needed to be before action name.
This commit is contained in:
parent
e0063d8808
commit
10bea1b77e
@ -1414,7 +1414,9 @@ def main(args: typing.Optional[typing.Sequence[str]] = None,
|
||||
|
||||
:return: Return code of the application
|
||||
"""
|
||||
p_args = parser.parse_args(args)
|
||||
# do two passes to allow global options after command name too
|
||||
p_args, args = parser.parse_known_args(args)
|
||||
p_args = parser.parse_args(args, p_args)
|
||||
|
||||
if not p_args.command:
|
||||
parser.error('A command needs to be specified.')
|
||||
|
Loading…
Reference in New Issue
Block a user