diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-09 22:56:24 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-09 22:56:24 -0400 |
commit | 0e8ab46adfbeac86291899115a28a36f6eb066bc (patch) | |
tree | 5cb0ac1cc50c821bcccffba77d79a472c6008bbc | |
parent | 63f0aa3256ef4422c2b3eab3d9ea0d44a15cc93e (diff) | |
download | cmd2-git-0e8ab46adfbeac86291899115a28a36f6eb066bc.tar.gz |
Docstring updates
-rw-r--r-- | cmd2/cmd2.py | 22 | ||||
-rw-r--r-- | docs/argument_processing.rst | 12 | ||||
-rw-r--r-- | tests/conftest.py | 16 | ||||
-rw-r--r-- | tests/test_cmd2.py | 12 |
4 files changed, 31 insertions, 31 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index d93a25b3..cc656e01 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2333,7 +2333,7 @@ Usage: Usage: unalias [-a] name [name ...] @with_argument_list def do_help(self, arglist: List[str]) -> None: - """List available commands with "help" or detailed help with "help cmd".""" + """ List available commands with "help" or detailed help with "help cmd" """ if not arglist or (len(arglist) == 1 and arglist[0] in ('--verbose', '-v')): verbose = len(arglist) == 1 and arglist[0] in ('--verbose', '-v') self._help_menu(verbose) @@ -2472,22 +2472,22 @@ Usage: Usage: unalias [-a] name [name ...] self.stdout.write("\n") def do_shortcuts(self, _: str) -> None: - """Lists shortcuts (aliases) available.""" + """Lists shortcuts available""" result = "\n".join('%s: %s' % (sc[0], sc[1]) for sc in sorted(self.shortcuts)) self.poutput("Shortcuts for other commands:\n{}\n".format(result)) def do_eof(self, _: str) -> bool: - """Called when <Ctrl>-D is pressed.""" + """Called when <Ctrl>-D is pressed""" # End of script should not exit app, but <Ctrl>-D should. return self._STOP_AND_EXIT def do_quit(self, _: str) -> bool: - """Exits this application.""" + """Exits this application""" self._should_quit = True return self._STOP_AND_EXIT def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]], prompt: str='Your choice? ') -> str: - """Presents a numbered menu to the user. Modelled after + """Presents a numbered menu to the user. Modeled after the bash shell's SELECT. Returns the item chosen. Argument ``opts`` can be: @@ -2611,7 +2611,7 @@ Usage: Usage: unalias [-a] name [name ...] self.show(args, param) def do_shell(self, statement: Statement) -> None: - """Execute a command as if at the OS prompt. + """Execute a command as if at the OS prompt Usage: shell <command> [arguments]""" import subprocess @@ -2909,7 +2909,7 @@ a..b, a:b, a:, ..b items by indices (inclusive) @with_argparser(history_parser) def do_history(self, args: argparse.Namespace) -> None: - """View, run, edit, save, or clear previously entered commands.""" + """View, run, edit, save, or clear previously entered commands""" if args.clear: # Clear command and readline history @@ -3053,7 +3053,7 @@ a..b, a:b, a:, ..b items by indices (inclusive) @with_argument_list def do_edit(self, arglist: List[str]) -> None: - """Edit a file in a text editor. + """Edit a file in a text editor Usage: edit [file_path] Where: @@ -3085,7 +3085,7 @@ The editor used is determined by the ``editor`` settable parameter. @with_argument_list def do__relative_load(self, arglist: List[str]) -> None: - """Runs commands in script file that is encoded as either ASCII or UTF-8 text. + """Runs commands in script file that is encoded as either ASCII or UTF-8 text Usage: _relative_load <file_path> @@ -3110,13 +3110,13 @@ NOTE: This command is intended to only be used within text file scripts. self.do_load([relative_path]) def do_eos(self, _: str) -> None: - """Handles cleanup when a script has finished executing.""" + """Handles cleanup when a script has finished executing""" if self._script_dir: self._script_dir.pop() @with_argument_list def do_load(self, arglist: List[str]) -> None: - """Runs commands in script file that is encoded as either ASCII or UTF-8 text. + """Runs commands in script file that is encoded as either ASCII or UTF-8 text Usage: load <file_path> diff --git a/docs/argument_processing.rst b/docs/argument_processing.rst index 022ea4d6..8aed7498 100644 --- a/docs/argument_processing.rst +++ b/docs/argument_processing.rst @@ -278,16 +278,16 @@ the help categories with per-command Help Messages:: ================================================================================ alias Define or display aliases config Config command - edit Edit a file in a text editor. - help List available commands with "help" or detailed help with "help cmd". + edit Edit a file in a text editor + help List available commands with "help" or detailed help with "help cmd" history usage: history [-h] [-r | -e | -s | -o FILE | -t TRANSCRIPT] [arg] - load Runs commands in script file that is encoded as either ASCII or UTF-8 text. + load Runs commands in script file that is encoded as either ASCII or UTF-8 text py Invoke python command, shell, or script pyscript Runs a python script file inside the console - quit Exits this application. + quit Exits this application set usage: set [-h] [-a] [-l] [settable [settable ...]] - shell Execute a command as if at the OS prompt. - shortcuts Lists shortcuts (aliases) available. + shell Execute a command as if at the OS prompt + shortcuts Lists shortcuts available unalias Unsets aliases version Version command diff --git a/tests/conftest.py b/tests/conftest.py index f86a4c63..a23c44d0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -35,23 +35,23 @@ BASE_HELP_VERBOSE = """ Documented commands (type help <topic>): ================================================================================ alias Define or display aliases -edit Edit a file in a text editor. -help List available commands with "help" or detailed help with "help cmd". -history View, run, edit, save, or clear previously entered commands. -load Runs commands in script file that is encoded as either ASCII or UTF-8 text. +edit Edit a file in a text editor +help List available commands with "help" or detailed help with "help cmd" +history View, run, edit, save, or clear previously entered commands +load Runs commands in script file that is encoded as either ASCII or UTF-8 text py Invoke python command, shell, or script pyscript Runs a python script file inside the console -quit Exits this application. +quit Exits this application set Sets a settable parameter or shows current settings of parameters -shell Execute a command as if at the OS prompt. -shortcuts Lists shortcuts (aliases) available. +shell Execute a command as if at the OS prompt +shortcuts Lists shortcuts available unalias Unsets aliases """ # Help text for the history command HELP_HISTORY = """Usage: history [arg] [-h] [-r | -e | -s | -o FILE | -t TRANSCRIPT | -c] -View, run, edit, save, or clear previously entered commands. +View, run, edit, save, or clear previously entered commands positional arguments: arg empty all history items diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 3aeb9959..fdf0f661 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1244,15 +1244,15 @@ diddly This command does diddly Other ================================================================================ alias Define or display aliases -help List available commands with "help" or detailed help with "help cmd". -history View, run, edit, save, or clear previously entered commands. -load Runs commands in script file that is encoded as either ASCII or UTF-8 text. +help List available commands with "help" or detailed help with "help cmd" +history View, run, edit, save, or clear previously entered commands +load Runs commands in script file that is encoded as either ASCII or UTF-8 text py Invoke python command, shell, or script pyscript Runs a python script file inside the console -quit Exits this application. +quit Exits this application set Sets a settable parameter or shows current settings of parameters -shell Execute a command as if at the OS prompt. -shortcuts Lists shortcuts (aliases) available. +shell Execute a command as if at the OS prompt +shortcuts Lists shortcuts available unalias Unsets aliases Undocumented commands: |