Split out parser generation into a separate function

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-07-08 12:15:23 +02:00
parent 5bf0041067
commit 274fa18712

View file

@ -412,9 +412,7 @@ def exit_on_common_errors():
except FileNotFoundError as e:
sys.exit(str(e))
@exit_on_common_errors()
def main():
def get_parser():
default_target = get_default_target()
parser = argparse.ArgumentParser("rust2rpm",
@ -461,6 +459,13 @@ def main():
"path/to/project/",
nargs="?")
parser.add_argument("version", nargs="?", help="crates.io version")
return parser
@exit_on_common_errors()
def main():
parser = get_parser()
args = parser.parse_args()
if args.show_license_map: