Verified Commit d639fbeb authored by Adam Mercer's avatar Adam Mercer
Browse files

check that the specified source rpm exists

parent 64c11501
......@@ -22,6 +22,8 @@
#
import argparse
import pathlib
import sys
#
# metadata
......@@ -37,12 +39,17 @@ def parse_options():
# define option parser
parser = argparse.ArgumentParser(description='Build RPMs using Koji')
parser.add_argument('--version', action='version', version=__version__)
parser.add_argument('source-rpm', nargs=1,
help='Source RPM to build with Koji')
parser.add_argument('srpm', nargs=1, help='Source RPM to build with Koji')
# parse options
args = parser.parse_args()
# check that source-rpm exists
srpm = pathlib.Path(args.srpm[0])
if not srpm.is_file():
print('File %s does not exist.' % args.srpm[0])
sys.exit(1)
return args
#
......@@ -51,7 +58,7 @@ def parse_options():
def main():
args = parse_options()
print(args)
print('source-rpm = %s' % args.srpm[0])
#
# main program entry point
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment