import sys, argparse, os from esds.helpers.platform import YAMLPlatformFile # Allow importlib to import file from current working directory sys.path.insert(0, os.getcwd()) 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: simulation=YAMLPlatformFile(args.platform) simulation.run() 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("command", help="Execute the specified command", nargs=argparse.REMAINDER) args = parser.parse_args() ##### Run commands if args.command: if args.command[0] == "run": run(args.command) else: parser.print_help()