@@ -69,23 +69,23 @@ user to enter commands, which are then executed by your program.
6969You may want to execute commands in your program without prompting the user for any input. There are
7070several ways you might accomplish this task. The easiest one is to pipe commands and their arguments
7171into your program via standard input. You don't need to do anything to your program in order to use
72- this technique. Here's a demonstration using the ` examples/example .py ` included in the source code
73- of ` cmd2 ` :
72+ this technique. Here's a demonstration using the ` examples/transcript_example .py ` included in the
73+ source code of ` cmd2 ` :
7474
75- $ echo "speak -p some words" | python examples/example .py
75+ $ echo "speak -p some words" | python examples/transcript_example .py
7676 omesay ordsway
7777
7878Using this same approach you could create a text file containing the commands you would like to run,
7979one command per line in the file. Say your file was called ` somecmds.txt ` . To run the commands in
8080the text file using your ` cmd2 ` program (from a Windows command prompt):
8181
82- c:\cmd2> type somecmds.txt | python.exe examples/example .py
82+ c:\cmd2> type somecmds.txt | python.exe examples/transcript_example .py
8383 omesay ordsway
8484
8585By default, ` cmd2 ` programs also look for commands pass as arguments from the operating system
8686shell, and execute those commands before entering the command loop:
8787
88- $ python examples/example .py help
88+ $ python examples/transcript_example .py help
8989
9090 Documented commands (use 'help -v' for verbose/'help <topic>' for details):
9191 ===========================================================================
@@ -99,8 +99,8 @@ example, you might have a command inside your `cmd2` program which itself accept
9999maybe even option strings. Say you wanted to run the ` speak ` command from the operating system
100100shell, but have it say it in pig latin:
101101
102- $ python example/example .py speak -p hello there
103- python example .py speak -p hello there
102+ $ python example/transcript_example .py speak -p hello there
103+ python transcript_example .py speak -p hello there
104104 usage: speak [-h] [-p] [-s] [-r REPEAT] words [words ...]
105105 speak: error: the following arguments are required: words
106106 *** Unknown syntax: -p
@@ -122,7 +122,7 @@ Check the source code of this example, especially the `main()` function, to see
122122Alternatively you can simply wrap the command plus arguments in quotes (either single or double
123123quotes):
124124
125- $ python example/example .py "speak -p hello there"
125+ $ python example/transcript_example .py "speak -p hello there"
126126 ellohay heretay
127127 (Cmd)
128128
@@ -148,6 +148,6 @@ quits while returning an exit code:
148148
149149Here is another example using ` quit ` :
150150
151- $ python example/example .py "speak -p hello there" quit
151+ $ python example/transcript_example .py "speak -p hello there" quit
152152 ellohay heretay
153153 $
0 commit comments