make named parameters mandatory

This commit is contained in:
Martin Sehnoutka 2019-06-21 13:19:18 +02:00 committed by Tom Gundersen
parent d3023ec7f7
commit 1d7f2461a0

View file

@ -44,10 +44,11 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Build operating system images")
parser.add_argument("pipeline_path", metavar="PIPELINE",
help="json file containing the pipeline that should be built")
parser.add_argument("--input", dest="input_dir", metavar="DIRECTORY", type=os.path.abspath,
help="provide the contents of DIRECTORY to the first stage")
parser.add_argument("--output", dest="output_dir", metavar="DIRECTORY", type=os.path.abspath,
help="provide the empty DIRECTORY as output argument to the last stage")
requiredNamed = parser.add_argument_group('required named arguments')
requiredNamed.add_argument("-i", "--input", dest="input_dir", metavar="DIRECTORY", type=os.path.abspath,
help="provide the contents of DIRECTORY to the first stage", required=True)
requiredNamed.add_argument("-o", "--output", dest="output_dir", metavar="DIRECTORY", type=os.path.abspath,
help="provide the empty DIRECTORY as output argument to the last stage", required=True)
args = parser.parse_args()
os.makedirs("/run/osbuild", exist_ok=True)