Update argument parser

This commit is contained in:
Loic Guegan 2022-09-11 17:51:47 +02:00
parent 30ec71a84c
commit 57f00b0b39

View file

@ -1,14 +1,23 @@
import sys, argparse import sys, argparse
def run(args): def run(arguments):
print(args) parser = argparse.ArgumentParser(description='Run a simulation')
parser.add_argument("platform", help="Run a simulation using a specific platform file")
args = parser.parse_args(arguments[1:])
if args.platform:
print("Run simulation using "+args.platform)
else:
parser.print_help()
def main(): def main():
##### Parse arguments ##### Parse arguments
parser = argparse.ArgumentParser(description='ESDS Simulator CLI toolbox. Allow you to run simulations and perform various tasks.') parser = argparse.ArgumentParser(
parser.add_argument("run", help="Run a simulation", nargs="*") description='ESDS Simulator CLI toolbox. Allow you to run simulations and perform various tasks.')
parser.add_argument("run", help="Run a simulation", nargs=argparse.REMAINDER)
args = parser.parse_args() args = parser.parse_args()
##### Run commands ##### Run commands
if args.run: if args.run:
run(args.run) run(args.run)
else:
parser.print_help()