From 01842297384ff300c09c2465267f5da60cf33287 Mon Sep 17 00:00:00 2001 From: konsthol Date: Sun, 19 Mar 2023 20:41:44 +0200 Subject: [PATCH] clarify further the brokenness of C++. why the fuck are we using C++? --- secdep.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/secdep.py b/secdep.py index b3ddc75..7d17b84 100755 --- a/secdep.py +++ b/secdep.py @@ -43,6 +43,8 @@ ENV_FILE = os.path.join(os.path.dirname(__file__), ".env") SECDEP_SSH_PUBLIC_KEY = os.path.join(os.path.dirname(__file__), "secdep.pub") SECDEP_SSH_PRIVATE_KEY = os.path.join(os.path.dirname(__file__), "secdep") +action_choices = ["delete","start","stop","reboot","deleteall","startall","stopall","rebootall"] + if not len(sys.argv) > 1: print("No arguments passed. Use -h or --help for help") exit(0) @@ -54,7 +56,7 @@ parser = argparse.ArgumentParser( parser.add_argument('-l', '--list', help='List all instances', action='store_true') parser.add_argument('-v', '--values', help='Change credential values', action='store_true') parser.add_argument('-P', '--provider', help='Cloud provider', choices=['gce', 'azure', 'aws']) -parser.add_argument('-a', '--action', help='Action to perform on a single or all instances', choices=['delete', 'start', 'stop', 'reboot', 'deleteall', 'startall', 'stopall', 'rebootall']) +parser.add_argument('-a', '--action', help='Action to perform on a single or all instances. Valid options are delete[all] start[all] stop[all] reboot[all]', choices=action_choices, metavar='ACTION') parser.add_argument('-c', '--create', help='Create an instance', action='store_true') parser.add_argument('-dep', '--deploy', help='Docker images to deploy', type=str, nargs='*', default=None, required=False) parser.add_argument('-I', '--listimages', help='List images', action='store_true')