summaryrefslogtreecommitdiff
path: root/docs/features/generating_output.rst
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-11-03 14:17:29 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2019-11-03 14:17:29 -0500
commitf626c98934000e3afc6e2e99f61396e56b23dc0c (patch)
tree90b9f01ea6e85bf0d221b1c405246558b098124c /docs/features/generating_output.rst
parent721cb0fa2e96222fe0b181d5adff8fa41465da70 (diff)
downloadcmd2-git-f626c98934000e3afc6e2e99f61396e56b23dc0c.tar.gz
Created a new documentation section on "Output redirection and pipes"
Also: - Moved existing output redirection documentation from "Generating Output" section there - Significantly expanded upon this - Improved documentation on Command Scripts - Added missing setting to Settings documentation section
Diffstat (limited to 'docs/features/generating_output.rst')
-rw-r--r--docs/features/generating_output.rst34
1 files changed, 0 insertions, 34 deletions
diff --git a/docs/features/generating_output.rst b/docs/features/generating_output.rst
index c03f8778..2ee820f1 100644
--- a/docs/features/generating_output.rst
+++ b/docs/features/generating_output.rst
@@ -42,40 +42,6 @@ messages. Users can control whether they would like to see these messages by
changing the value of the ``quiet`` setting.
-Output Redirection
-------------------
-
-As in a Unix shell, output of a command can be redirected:
-
- - sent to a file with ``>``, as in ``mycommand args > filename.txt``
- - appended to a file with ``>>``, as in ``mycommand args >> filename.txt``
- - piped (``|``) as input to operating-system commands, as in
- ``mycommand args | wc``
-
-
-
-.. note::
-
- If you wish to disable cmd2's output redirection and pipes features, you can
- do so by setting the ``allow_redirection`` attribute of your ``cmd2.Cmd``
- class instance to ``False``. This would be useful, for example, if you want
- to restrict the ability for an end user to write to disk or interact with
- shell commands for security reasons::
-
- from cmd2 import Cmd
- class App(Cmd):
- def __init__(self):
- self.allow_redirection = False
-
- cmd2's parser will still treat the ``>``, ``>>``, and `|` symbols as output
- redirection and pipe symbols and will strip arguments after them from the
- command line arguments accordingly. But output from a command will not be
- redirected to a file or piped to a shell command.
-
-If you need to include any of these redirection characters in your command, you
-can enclose them in quotation marks, ``mycommand 'with > in the argument'``.
-
-
Colored Output
--------------