mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Update cli
This commit is contained in:
parent
a83b267acd
commit
c3eb8db7a1
1 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import sys, argparse, os
|
import sys, argparse, os
|
||||||
from esds.helpers.platform import YAMLPlatformFile
|
from esds.helpers.platform import YAMLPlatformFile
|
||||||
|
from esds import __version__
|
||||||
|
|
||||||
# Allow importlib to import file from current working directory
|
# Allow importlib to import file from current working directory
|
||||||
sys.path.insert(0, os.getcwd())
|
sys.path.insert(0, os.getcwd())
|
||||||
|
@ -17,13 +18,17 @@ def run(arguments):
|
||||||
def main():
|
def main():
|
||||||
##### Parse arguments
|
##### Parse arguments
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description='ESDS Simulator CLI toolbox. Allow you to run simulations and perform various tasks.')
|
description='ESDS simulator command line interface. Run simulations and perform various simulation tasks.',
|
||||||
parser.add_argument("command", help="Execute the specified command", nargs=argparse.REMAINDER)
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
##### Run commands
|
##### Run commands
|
||||||
if args.command:
|
if args.command:
|
||||||
if args.command[0] == "run":
|
if args.command[0] == "run":
|
||||||
run(args.command)
|
run(args.command)
|
||||||
|
elif args.version:
|
||||||
|
print("ESDS v"+__version__)
|
||||||
else:
|
else:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
|
|
Loading…
Add table
Reference in a new issue