File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -424,16 +424,17 @@ def format_help(self, tokens: List[str]) -> str:
424424 """
425425 Supports cmd2's help command in the retrieval of help text
426426 :param tokens: command line tokens
427- :return: help text of the commmand being queried
427+ :return: help text of the command being queried
428428 """
429- # If our parser has subcommands, we must examine the tokens and check if any reference one.
429+ # If our parser has subcommands, we must examine the tokens and check if they are subcommands
430430 # If so, we will let the subcommand's parser handle the rest of the tokens via another AutoCompleter.
431431 if self ._subcommand_action is not None :
432432 for token_index , token in enumerate (tokens [1 :], start = 1 ):
433433 if token in self ._subcommand_action .choices :
434434 completer = AutoCompleter (self ._subcommand_action .choices [token ], self ._cmd2_app )
435435 return completer .format_help (tokens [token_index :])
436-
436+ else :
437+ break
437438 return self ._parser .format_help ()
438439
439440 def _complete_for_arg (self , arg_action : argparse .Action ,
You can’t perform that action at this time.
0 commit comments