diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-11 19:09:41 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-09-11 19:09:41 +0200 |
| commit | c3eb8db7a1e01dd2e7592b5f190bd94741798f98 (patch) | |
| tree | 83be57d77ccb59f81ad7413340c21146a388b78e | |
| parent | a83b267acd8c383a1f9f695df486bce1185a00f6 (diff) | |
Update cli
| -rw-r--r-- | esds/__main__.py | 9 |
1 files 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() |
