diff options
-rw-r--r-- | docs/transcript.rst | 6 | ||||
-rw-r--r-- | docs/unfreefeatures.rst | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/transcript.rst b/docs/transcript.rst index a2db3efd..184f129d 100644 --- a/docs/transcript.rst +++ b/docs/transcript.rst @@ -26,6 +26,12 @@ A transcript can automatically generated based upon commands previously executed This is by far the easiest way to generate a transcript. +.. warning:: + + Make sure you use the **poutput()** method in your ``cmd2`` application for generating command output. This method + of the ``cmd2.Cmd`` class ensure that output is properly redirected when redirecting to a file, pipeing to a shell + command, and when generating a transcript. + Manually -------- Here's a transcript created from ``python examples/example.py``:: diff --git a/docs/unfreefeatures.rst b/docs/unfreefeatures.rst index 2d497101..e92bf2d6 100644 --- a/docs/unfreefeatures.rst +++ b/docs/unfreefeatures.rst @@ -155,9 +155,14 @@ but ``print`` decreases output flexibility). ``cmd2`` applications can use ``self.poutput('output')``, ``self.pfeedback('message')``, and ``self.perror('errmsg')`` instead. These methods have these advantages: +- Handle output redirection to file and/or pipe appropriately - More concise - ``.pfeedback()`` destination is controlled by :ref:`quiet` parameter. +.. automethod:: cmd2.Cmd.poutput +.. automethod:: cmd2.Cmd.perror +.. automethod:: cmd2.Cmd.pfeedback + color ===== |