Commit 3126878d authored by Guido Trotter's avatar Guido Trotter

GenericMain, handle ParameterError from _ParseArgs

Before this case was not covered, and printed a stack trace.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 8b46606c
......@@ -747,7 +747,13 @@ def GenericMain(commands, override=None, aliases=None):
if aliases is None:
aliases = {}
func, options, args = _ParseArgs(sys.argv, commands, aliases)
try:
func, options, args = _ParseArgs(sys.argv, commands, aliases)
except errors.ParameterError, err:
result, err_msg = FormatError(err)
ToStderr(err_msg)
return 1
if func is None: # parse error
return 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment