INNER CODE UNIT · Python
parse_args
PyCQA/isort · isort/main.py:892
def parse_args(argv: Sequence[str] | None = None) -> dict[str, Any]:
argv = sys.argv[1:] if argv is None else list(argv)
parser = _build_arg_parser()
arguments = {key: value for key, value in vars(parser.parse_args(argv)).items() if value}
if "dont_order_by_type" in arguments:
arguments["order_by_type"] = False
del arguments["dont_order_by_type"]
if "dont_follow_links" in arguments:
arguments["follow_links"] = False
del arguments["dont_follow_links"]
if "dont_float_to_top" in arguments:
del arguments["dont_float_to_top"]
if arguments.get("float_to_top", False):
sys.exit("Can't set both --float-to-top and --dont-float-to-top.")
else:
arguments["float_to_top"] = False
multi_line_output = arguments.get("multi_line_output", None)