diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-01-29 19:27:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 19:27:43 -0500 |
commit | 052caa649be459145c5593f9515be8d3100a16c3 (patch) | |
tree | 1ea9343206b1c070460415f010c6d1086e514802 | |
parent | 26c140e891773f69850043b68c75d9467bf54e55 (diff) | |
parent | 6296d413ac1cee3577c19ba2bbf9da56202dc26d (diff) | |
download | cmd2-git-052caa649be459145c5593f9515be8d3100a16c3.tar.gz |
Merge branch 'master' into changelog_clarification
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | cmd2/cmd2.py | 3 | ||||
-rw-r--r-- | docs/features/help.rst | 8 | ||||
-rw-r--r-- | docs/features/initialization.rst | 2 | ||||
-rw-r--r-- | docs/features/os.rst | 4 |
5 files changed, 13 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 94eef363..342aeaa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## 0.9.26 (TBD, 2020) +* Enhancements + * Changed the default help text to make `help -v` more discoverable * Breaking changes * Renamed `locals_in_py` attribute of `cmd2.Cmd` to `self_in_py` * The following public attributes of `cmd2.Cmd` are no longer settable at runtime by default: diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index f3b7c4a4..34435ed0 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -279,6 +279,9 @@ class Cmd(cmd.Cmd): # The multiline command currently being typed which is used to tab complete multiline commands. self._multiline_in_progress = '' + # Set the header used for the help function's listing of documented functions + self.doc_header = "Documented commands (use 'help -v' for verbose/'help <topic>' for details):" + # The error that prints when no help information can be found self.help_error = "No help on {}" diff --git a/docs/features/help.rst b/docs/features/help.rst index 03e0867b..920516f5 100644 --- a/docs/features/help.rst +++ b/docs/features/help.rst @@ -12,15 +12,15 @@ Categorizing Commands By default, the ``help`` command displays:: - Documented commands (type help <topic>): - ======================================== + Documented commands (use 'help -v' for verbose/'help <topic>' for details): + =========================================================================== alias help ipy py run_pyscript set shortcuts edit history macro quit run_script shell If you have a large number of commands, you can optionally group your commands into categories. Here's the output from the example ``help_categories.py``:: - Documented commands (type help <topic>): + Documented commands (use 'help -v' for verbose/'help <topic>' for details): Application Management ====================== @@ -90,7 +90,7 @@ Using the ``categorize()`` function: The ``help`` command also has a verbose option (``help -v`` or ``help --verbose``) that combines the help categories with per-command Help Messages:: - Documented commands (type help <topic>): + Documented commands (use 'help -v' for verbose/'help <topic>' for details): Application Management ================================================================================ diff --git a/docs/features/initialization.rst b/docs/features/initialization.rst index c5df5af8..46b4ecd2 100644 --- a/docs/features/initialization.rst +++ b/docs/features/initialization.rst @@ -108,6 +108,8 @@ override: support commands that are only available during specific states of the application. This dictionary's keys are the command names and its values are DisabledCommand objects. +- **doc_header**: Set the header used for the help function's listing of + documented functions - **echo**: if ``True``, each command the user issues will be repeated to the screen before it is executed. This is particularly useful when running scripts. This behavior does not occur when running a command at the prompt. diff --git a/docs/features/os.rst b/docs/features/os.rst index 40a7cbf4..b6f9b61f 100644 --- a/docs/features/os.rst +++ b/docs/features/os.rst @@ -49,8 +49,8 @@ loop:: $ python examples/example.py help - Documented commands (type help <topic>): - ======================================== + Documented commands (use 'help -v' for verbose/'help <topic>' for details): + =========================================================================== alias help macro orate quit run_script set shortcuts edit history mumble py run_pyscript say shell speak |