diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-23 21:16:52 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-23 21:16:52 -0400 |
commit | fa981071b66c750eb7241cd8d9c48a032da723bc (patch) | |
tree | 1d9fe334f44acdf42fed1b250f76852696d6186e /cmd2 | |
parent | 028660d87c41b7b5bb2f3e6004713bb7003cc03e (diff) | |
download | cmd2-git-fa981071b66c750eb7241cd8d9c48a032da723bc.tar.gz |
Updated docstrings
Diffstat (limited to 'cmd2')
-rw-r--r-- | cmd2/cmd2.py | 12 | ||||
-rw-r--r-- | cmd2/parsing.py | 15 |
2 files changed, 16 insertions, 11 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index db8dcee2..77bf5853 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -1732,7 +1732,7 @@ class Cmd(cmd.Cmd): :param line: command line to run :param expand: If True, then aliases, macros, and shortcuts will be expanded. - Set this to False if the command line should not be altered. + Set this to False if the command token should not be altered. Defaults to True. :param add_to_history: If True, then add this command to history. Defaults to True. :param py_bridge_call: This should only ever be set to True by PyBridge to signify the beginning of an app() call from Python. It is used to enable/disable the storage of the @@ -1866,7 +1866,7 @@ class Cmd(cmd.Cmd): :param cmds: commands to run :param expand: If True, then aliases, macros, and shortcuts will be expanded. - Set this to False if the command line should not be altered. + Set this to False if the command token should not be altered. Defaults to True. :param add_to_history: If True, then add these commands to history. Defaults to True. :return: True if running of commands should stop """ @@ -1891,8 +1891,8 @@ class Cmd(cmd.Cmd): backwards compatibility with the standard library version of cmd. :param line: the line being parsed - :param expand: If True, then aliases, macros, and shortcuts will be expanded. - Set this to False if the command line should not be altered. + :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 completed Statement """ while True: @@ -1951,7 +1951,7 @@ class Cmd(cmd.Cmd): :param line: the line being parsed :param expand: If True, then aliases, macros, and shortcuts will be expanded. - Set this to False if the command line should not be altered. + Set this to False if the command token should not be altered. Defaults to True. :return: parsed command line as a Statement """ used_macros = [] @@ -2191,7 +2191,7 @@ class Cmd(cmd.Cmd): :param statement: intended to be a Statement instance parsed command from the input stream, alternative acceptance of a str is present only for backward compatibility with cmd :param expand: If True, then aliases, macros, and shortcuts will be expanded. - Set this to False if the command line should not be altered. + Set this to False if the command token should not be altered. Defaults to True. :param add_to_history: If True, then add this command to history. Defaults to True. :return: a flag indicating whether the interpretation of commands should stop """ 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) |