From c39f329cc0b527824373786759ef9da4ad12776f Mon Sep 17 00:00:00 2001
From: atlurie <atlurie@uab.edu>
Date: Thu, 7 Apr 2022 23:02:28 -0500
Subject: [PATCH] Modify the service arg to show more robust help/usage msg.

With this change the argument only allows one of the 3 choices
It also takes a default value in case the arg is not given
---
 account_manager.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/account_manager.py b/account_manager.py
index 5b36bfb..5cecb28 100755
--- a/account_manager.py
+++ b/account_manager.py
@@ -12,7 +12,7 @@ import rabbit_config as rcfg
 parser = argparse.ArgumentParser(description = "Account management driver script")
 parser.add_argument("username", help="Username that should be locked/unlocked")
 parser.add_argument("state", help="Choose from states (ok,block,certify) to put the user in")
-parser.add_argument("service", nargs='*', help="List one or more services to be blocked")
+parser.add_argument("-s", "--service", nargs='+', default='all', choices=['ssh', 'newjobs', 'all'], help="List one or more services to be blocked (default: %(default)s)")
 parser.add_argument(
     "-a", "--all", help="Block all services")
 parser.add_argument(
-- 
GitLab