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
def run(args):
print(args)
def run(arguments):
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():
##### Parse arguments
parser = argparse.ArgumentParser(description='ESDS Simulator CLI toolbox. Allow you to run simulations and perform various tasks.')
parser.add_argument("run", help="Run a simulation", nargs="*")
parser = argparse.ArgumentParser(
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()
##### Run commands
if args.run:
run(args.run)
else:
parser.print_help()