From fa981071b66c750eb7241cd8d9c48a032da723bc Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 23 Jul 2019 21:16:52 -0400 Subject: Updated docstrings --- cmd2/parsing.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cmd2/parsing.py') diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 8602bb3d..5c0bec06 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -365,8 +365,7 @@ class StatementParser: :param line: the command line being lexed :param expand: If True, then aliases and shortcuts will be expanded. - Set this to False if no expansion should occur because the command name is already known. - Otherwise the command could be expanded if it matched an alias name. + Set this to False if the command token should not be altered. Defaults to True. :return: A list of tokens :raises ValueError if there are unclosed quotation marks. """ @@ -394,9 +393,8 @@ class StatementParser: :param line: the command line being parsed :param expand: If True, then aliases and shortcuts will be expanded. - Set this to False if no expansion should occur because the command name is already known. - Otherwise the command could be expanded if it matched an alias name. - :return: A parsed Statement + Set this to False if the command token should not be altered. Defaults to True. + :return: the created Statement :raises ValueError if there are unclosed quotation marks """ @@ -558,7 +556,14 @@ class StatementParser: Different from parse(), this method does not remove redundant whitespace within args. However, it does ensure args has no leading or trailing whitespace. + + :param rawinput: the command line as entered by the user + :param expand: If True, then aliases and shortcuts will be expanded. + Set this to False if the command token should not be altered. Defaults to True. + :return: the created Statement """ + line = rawinput + # expand shortcuts and aliases if expand: line = self._expand(rawinput) -- cgit v1.2.1