summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-29 00:57:49 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-29 00:57:49 -0500
commit5f124721b7c791c579062d9e3649b2b3646ccc8b (patch)
treed571e28844d35e69c6e0ecce38b93ffbd7f873c1
parente87cadfbaeda0bb0197ce959107bda0db89514ea (diff)
downloadcmd2-git-5f124721b7c791c579062d9e3649b2b3646ccc8b.tar.gz
Attempt to make "help -v" more discoverable by changing the default help text
-rw-r--r--cmd2/cmd2.py3
-rw-r--r--docs/features/help.rst8
-rw-r--r--docs/features/initialization.rst2
-rw-r--r--docs/features/os.rst4
4 files changed, 11 insertions, 6 deletions
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