From 269eee248d24acbb12f13ab519dfbe1c881d3bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Mon, 8 May 2023 19:22:43 -0600 Subject: First step to adding filters to accounts. --- utils/args.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'utils') diff --git a/utils/args.py b/utils/args.py index e39d2fe..f479628 100644 --- a/utils/args.py +++ b/utils/args.py @@ -14,7 +14,8 @@ def get_arguments(): parser.add_argument('-v', '--version', action='version', version='%(prog)s 0.1') - parser.add_argument('verb', metavar='Action', action='store', + parser.add_argument('verb', metavar='Action', + action='store', nargs='+', help='Specify an action between balance, report and \ print.') parser.add_argument('-S', '--sort', metavar='value-expression', @@ -40,8 +41,8 @@ def test_args(my_args): 'register', 'reg', 'r', 'print' ] - if my_args.verb not in valid_verbs: - raise Exception(f'{my_args.verb} is NOT a valid verb! Valid verbs are: {", ".join(valid_verbs)}.') + if my_args.verb[0] not in valid_verbs: + raise Exception(f'{my_args.verb[0]} is NOT a valid verb! Valid verbs are: {", ".join(valid_verbs)}.') # Test if expression for sorting is valid. # TODO: How can we validate an expression??? -- cgit v1.2.3