From c3eb8db7a1e01dd2e7592b5f190bd94741798f98 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 11 Sep 2022 19:09:41 +0200 Subject: [PATCH] Update cli --- esds/__main__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/esds/__main__.py b/esds/__main__.py index 5e818de..35637c1 100644 --- a/esds/__main__.py +++ b/esds/__main__.py @@ -1,5 +1,6 @@ import sys, argparse, os from esds.helpers.platform import YAMLPlatformFile +from esds import __version__ # Allow importlib to import file from current working directory sys.path.insert(0, os.getcwd()) @@ -17,13 +18,17 @@ def run(arguments): 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) + description='ESDS simulator command line interface. Run simulations and perform various simulation tasks.', + formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument("command", help="Execute the specified command.\nAvailable commands are: run", nargs=argparse.REMAINDER) + parser.add_argument("--version", help="Show esds version", action="store_true") args = parser.parse_args() ##### Run commands if args.command: if args.command[0] == "run": run(args.command) + elif args.version: + print("ESDS v"+__version__) else: parser.print_help()