summaryrefslogtreecommitdiff
path: root/docs/features
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-01-29 20:07:46 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-01-29 20:07:46 -0500
commit434a01f44e7d2302b4deef8f2e8069cbc26df560 (patch)
treecb3d5425668954fdd92989121ab53741c56908f8 /docs/features
parent82fe1d473ca2fe0278568036659fa78cb3c17f78 (diff)
parentcd377071cd122bc92a829322e00ae43fd5a5c254 (diff)
downloadcmd2-git-434a01f44e7d2302b4deef8f2e8069cbc26df560.tar.gz
Merge branch 'master' into 2.0
Diffstat (limited to 'docs/features')
-rw-r--r--docs/features/commands.rst4
-rw-r--r--docs/features/modular_commands.rst2
-rw-r--r--docs/features/startup_commands.rst9
3 files changed, 12 insertions, 3 deletions
diff --git a/docs/features/commands.rst b/docs/features/commands.rst
index 8e61a472..cc603f70 100644
--- a/docs/features/commands.rst
+++ b/docs/features/commands.rst
@@ -127,7 +127,7 @@ without errors), and that ``cmd2`` should prompt the user for more input.
If you return ``True`` from a command method, that indicates to ``cmd2`` that
it should stop prompting for user input and cleanly exit. ``cmd2`` already
includes a ``quit`` command, but if you wanted to make another one called
-``finis`` you could::
+``finish`` you could::
def do_finish(self, line):
"""Exit the application"""
@@ -156,7 +156,7 @@ system shell::
"""A simple cmd2 application."""
def do_bail(self, line):
- """Exit the application""
+ """Exit the application"""
self.perror("fatal error, exiting")
self.exit_code = 2
return true
diff --git a/docs/features/modular_commands.rst b/docs/features/modular_commands.rst
index 790b933e..8bd9ba2f 100644
--- a/docs/features/modular_commands.rst
+++ b/docs/features/modular_commands.rst
@@ -29,7 +29,7 @@ Features
See API documentation for :attr:`cmd2.command_definition.CommandSet`
-See the examples for more details: https://github.com/python-cmd2/cmd2/tree/master/plugins/command_sets/examples
+See [the examples](https://github.com/python-cmd2/cmd2/tree/master/examples/modular_commands) for more details.
Defining Commands
diff --git a/docs/features/startup_commands.rst b/docs/features/startup_commands.rst
index aaaf7722..f105054b 100644
--- a/docs/features/startup_commands.rst
+++ b/docs/features/startup_commands.rst
@@ -64,3 +64,12 @@ like so::
This text file should contain a :ref:`Command Script
<features/scripting:Command Scripts>`. See the AliasStartup_ example for a
demonstration.
+
+You can silence a startup script's output by setting ``silent_startup_script``
+to True::
+
+ cmd2.Cmd.__init__(self, startup_script='.cmd2rc', silent_startup_script=True)
+
+Anything written to stderr will still print. Additionally, a startup script
+cannot be silenced if ``allow_redirection`` is False since silencing works
+by redirecting a script's output to ``os.devnull``.