we got it to extract the tar file! :D
This commit is contained in:
16
src/main.py
16
src/main.py
@@ -1,5 +1,7 @@
|
||||
from rich import print
|
||||
import argparse
|
||||
import os, sys
|
||||
|
||||
from install import install
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
@@ -10,6 +12,7 @@ def parse_arguments():
|
||||
# install command
|
||||
install_command = sub_parsers.add_parser(name="install", description="install a mineral")
|
||||
install_command.add_argument("name", help="name of the mineral to install")
|
||||
install_command.add_argument("--max-retries", help="max number of download retries before giving up", default=3, type=int)
|
||||
|
||||
# uninstall command
|
||||
uninstall_command = sub_parsers.add_parser(name="uninstall", description="uninstall a mineral")
|
||||
@@ -20,7 +23,7 @@ def parse_arguments():
|
||||
list_command.add_argument("--env_name", help="list all minerals from a specific environment.", default=None, required=False)
|
||||
|
||||
# env command
|
||||
env_command = sub_parsers.add_parser(name="env", description="manage Ground environments")
|
||||
"""env_command = sub_parsers.add_parser(name="env", description="manage Ground environments")
|
||||
env_sub_parsers = env_command.add_subparsers(dest="env_command")
|
||||
|
||||
env_new_command = env_sub_parsers.add_parser(name="new", description="create a new environment")
|
||||
@@ -31,20 +34,23 @@ def parse_arguments():
|
||||
env_destroy_command.add_argument("name", help="name of the environment to DESTROYYY")
|
||||
env_destroy_command.add_argument("--confirm-yes", action="store_true", help="don't ask for confirmation (DANGEROUS)")
|
||||
|
||||
env_list_command = env_sub_parsers.add_parser(name="list", description="list all environments")
|
||||
env_list_command = env_sub_parsers.add_parser(name="list", description="list all environments")"""
|
||||
|
||||
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
if not args.command:
|
||||
arg_parser.print_help()
|
||||
sys.exit(0)
|
||||
if args.command == "env" and not args.env_command:
|
||||
env_command.print_help()
|
||||
sys.exit(0)
|
||||
|
||||
if args.command == "install":
|
||||
install(args)
|
||||
|
||||
def main():
|
||||
parse_arguments()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user