mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Update argument parser
This commit is contained in:
parent
30ec71a84c
commit
57f00b0b39
1 changed files with 13 additions and 4 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Reference in a new issue