Split out parser generation into a separate function
This commit is contained in:
parent
5bf0041067
commit
274fa18712
1 changed files with 8 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue