mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 19:22:16 +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):
|
def preprocess_args(self, args):
|
||||||
"""Work around some limitations in argparse.
|
"""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 i,token in enumerate(args):
|
||||||
for token in args:
|
|
||||||
if token in VERBS:
|
if token in VERBS:
|
||||||
return args
|
reordered = args[:i] + args[i+1:] + [args[i]]
|
||||||
return ["run"] + args
|
return reordered
|
||||||
|
return args + ["run"]
|
||||||
|
|
||||||
def prescan_for_flag(self, flag, possible_arguments):
|
def prescan_for_flag(self, flag, possible_arguments):
|
||||||
"""Checks cli input for flags.
|
"""Checks cli input for flags.
|
||||||
|
|||||||
Reference in New Issue
Block a user