@@ -348,9 +348,10 @@ def tokenize(self, line: str, expand: bool = True) -> List[str]:
348348 Lex a string into a list of tokens. Shortcuts and aliases are expanded and comments are removed
349349
350350 :param line: the command line being lexed
351- :param expand: if True, then aliases and shortcuts will be expanded
352- set this to False if the first token does not need to be expanded
353- because the command name is already known (Defaults to True)
351+ :param expand: If True, then aliases and shortcuts will be expanded.
352+ Set this to False if no expansion should occur because the command name is already known.
353+ Otherwise the command could be expanded if it matched an alias name. This is for cases where
354+ a do_* function was called manually (e.g do_help('alias').
354355 :return: A list of tokens
355356 :raises ValueError if there are unclosed quotation marks.
356357 """
@@ -377,9 +378,10 @@ def parse(self, line: str, expand: bool = True) -> Statement:
377378 redirection directives.
378379
379380 :param line: the command line being parsed
380- :param expand: if True, then aliases and shortcuts will be expanded
381- set this to False if the first token does not need to be expanded
382- because the command name is already known (Defaults to True)
381+ :param expand: If True, then aliases and shortcuts will be expanded.
382+ Set this to False if no expansion should occur because the command name is already known.
383+ Otherwise the command could be expanded if it matched an alias name. This is for cases where
384+ a do_* function was called manually (e.g do_help('alias').
383385 :return: A parsed Statement
384386 :raises ValueError if there are unclosed quotation marks
385387 """
0 commit comments