quick clean of arg parsing function by using default param

This commit is contained in:
Jonathan Wren 2020-07-02 21:46:03 -07:00
parent ef9cd5c2bf
commit 1d5c065b1f

View file

@ -18,7 +18,7 @@ class WrappingFormatter(argparse.RawDescriptionHelpFormatter):
return textwrap.wrap(text, width=56) return textwrap.wrap(text, width=56)
def parse_args_before_config(args=None): def parse_args_before_config(args=[]):
""" """
Argument parsing that is doable before the config is available. Argument parsing that is doable before the config is available.
Everything else goes into "text" for later parsing. Everything else goes into "text" for later parsing.
@ -264,9 +264,6 @@ def parse_args_before_config(args=None):
const=None, const=None,
) )
if not args:
args = []
# Handle '-123' as a shortcut for '-n 123' # Handle '-123' as a shortcut for '-n 123'
num = re.compile(r"^-(\d+)$") num = re.compile(r"^-(\d+)$")
args = [num.sub(r"-n \1", arg) for arg in args] args = [num.sub(r"-n \1", arg) for arg in args]