summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 7a544850..dec0a04d 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2573,6 +2573,10 @@ class Cmd(cmd.Cmd):
if not tokens:
return []
+ # Must have at least 3 args for 'help command subcommand'
+ if len(tokens) < 3:
+ return []
+
# Find where the command is by skipping past any flags
cmd_index = 1
for cur_token in tokens[cmd_index:]: