Use empty argument list in cmdhelp
If a wrong command name is used (e.g. typo), cmdhelp is triggered.
However, if user specifies any additional arguments (other than -h),
then user is presented with not so useful message.
This CL calls cmdhelp with no arguments.
Fixed: 1352093
Change-Id: I30c0b5f580f18b4fa2cb59d3195b67bb083f3442
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3828794
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
diff --git a/subcommand.py b/subcommand.py
index f77a8e4..9d468d6 100644
--- a/subcommand.py
+++ b/subcommand.py
@@ -255,7 +255,9 @@
if cmdhelp:
# Not a known command. Default to help.
self._add_command_usage(parser, cmdhelp)
- return cmdhelp(parser, args)
+ # Don't pass list of arguments as those may not be supported by cmdhelp.
+ # See: https://crbug.com/1352093
+ return cmdhelp(parser, [])
# Nothing can be done.
return 2