Skip to content
Snippets Groups Projects
Verified Commit 2d2b668a authored by David Hoese's avatar David Hoese
Browse files

Fix command parsing in tidy script

parent b49febb2
No related branches found
No related tags found
No related merge requests found
...@@ -245,6 +245,11 @@ def main(): ...@@ -245,6 +245,11 @@ def main():
default="", default="",
help="used in product filename, see metobs.util for details", help="used in product filename, see metobs.util for details",
) )
parser.add_argument(
"command",
nargs="*",
help="Command to run (use 'help' for available options)",
)
args = parser.parse_args() args = parser.parse_args()
if args.self_test: if args.self_test:
import doctest import doctest
...@@ -305,12 +310,13 @@ def main(): ...@@ -305,12 +310,13 @@ def main():
} }
) )
if (not args) or (args[0] not in commands): command = args.command
if not command or command[0] not in commands:
parser.print_help() parser.print_help()
_help() _help()
return 9 return 9
else: else:
locals()[args[0]](*args[1:]) commands[command[0]](*command[1:])
return 0 return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment