Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_args(args: List[str]):
"""Parse input arguments"""
parser = argparse.ArgumentParser(
description="flupy: a fluent interface for python",
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__)
parser.add_argument("command", help="command to execute against input")
parser.add_argument("-f", "--file", help="path to input file")
parser.add_argument(
"-i",
"--import",
nargs="*",
default=[],
help="modules to import\n" \
"Syntax: ::\n" \
"Examples:\n" \
"\t'import os' = '-i os'\n" \
"\t'import os as op_sys' = '-i os::op_sys'\n" \
"\t'from os import environ' = '-i os:environ'\n" \
"\t'from os import environ as env' = '-i os:environ:env'\n"
)
return parser.parse_args(args)