diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-18 20:45:36 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-03-18 20:45:36 -0400 |
| commit | 3928910d6e14699515601ecee23e201d4b7309d1 (patch) | |
| tree | 57bcc8cad7e1c175d5efac454183cc4a9211954c /docs/transcript.rst | |
| parent | 83a28727d012ab067d18d89d3b1ce6410459f67b (diff) | |
| download | cmd2-git-3928910d6e14699515601ecee23e201d4b7309d1.tar.gz | |
Added load -r flag for recording a transcript based on a script file
The load command now supports the -r/--record_transcript flag for recording a transcript file based on a script file.
Diffstat (limited to 'docs/transcript.rst')
| -rw-r--r-- | docs/transcript.rst | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/docs/transcript.rst b/docs/transcript.rst index 36b35fcf..91679641 100644 --- a/docs/transcript.rst +++ b/docs/transcript.rst @@ -13,9 +13,9 @@ from commands that produce dynamic or variable output. Creating a transcript ===================== -Automatically -------------- -A transcript can automatically generated based upon commands previously executed in the *history*:: +Automatically from history +-------------------------- +A transcript can automatically generated based upon commands previously executed in the *history* using ``history -t``:: (Cmd) help ... @@ -32,6 +32,17 @@ This is by far the easiest way to generate a transcript. of the ``cmd2.Cmd`` class ensure that output is properly redirected when redirecting to a file, piping to a shell command, and when generating a transcript. +Automatically from a script file +-------------------------------- +A transcript can also be automatically generated from a script file using ``load -r``:: + + (Cmd) load scripts/script.txt -r transcript.txt + 2 commands and their outputs saved to transcript file 'transcript.txt' + (Cmd) + +This is a particularly attractive option for automatically regenerating transcripts for regression testing as your ``cmd2`` +application changes. + Manually -------- Here's a transcript created from ``python examples/example.py``:: |
