mirror of
https://github.com/certbot/certbot.git
synced 2026-07-31 18:25:24 +02:00
Move the verb/subcommand to the end of the argparse line
This commit is contained in:
+6
-5
@@ -495,13 +495,14 @@ class HelpfulArgumentParser(object):
|
||||
def preprocess_args(self, args):
|
||||
"""Work around some limitations in argparse.
|
||||
|
||||
Currently, add the default verb "run" as a default.
|
||||
Currently: add the default verb "run" as a default, and ensure that the
|
||||
subcommand / verb comes last.
|
||||
"""
|
||||
|
||||
for token in args:
|
||||
for i,token in enumerate(args):
|
||||
if token in VERBS:
|
||||
return args
|
||||
return ["run"] + args
|
||||
reordered = args[:i] + args[i+1:] + [args[i]]
|
||||
return reordered
|
||||
return args + ["run"]
|
||||
|
||||
def prescan_for_flag(self, flag, possible_arguments):
|
||||
"""Checks cli input for flags.
|
||||
|
||||
Reference in New Issue
Block a user