Mercurial > python-cmd2
comparison README.txt @ 115:0820c42ea23e
new README
author | catherine@Elli.myhome.westell.com |
---|---|
date | Sat, 25 Oct 2008 20:47:53 -0400 |
parents | e3b8eaadea56 |
children | 06f5eba2f588 |
comparison
equal
deleted
inserted
replaced
114:f509d8b462b3 | 115:0820c42ea23e |
---|---|
109 unittest.main() | 109 unittest.main() |
110 else: | 110 else: |
111 app = CmdLineApp() | 111 app = CmdLineApp() |
112 app.cmdloop() | 112 app.cmdloop() |
113 | 113 |
114 Sample session using the above code :: | 114 The following is a sample session running example.py. |
115 | 115 Thanks to TestMyAppCase(Cmd2TestCase), it also serves as a test |
116 c:\cmd2>python cmd2_example.py | 116 suite for example.py when saved as `exampleSession.txt`. |
117 (Cmd) speak softly | 117 Running `python example.py -t` will run all the commands in the |
118 softly | 118 transcript against example.py, verifying that the output produced |
119 (Cmd) speak --piglatin softly | 119 is as expected. |
120 oftlysay | 120 |
121 (Cmd) speak -psr 2 softly | 121 exampleSession.txt:: |
122 OFTLYSAY | 122 |
123 OFTLYSAY | 123 (Cmd) help |
124 (Cmd) speak --repeat 1000000 softly | 124 |
125 softly | 125 Documented commands (type help <topic>): |
126 softly | 126 ======================================== |
127 softly | 127 _load edit history li load r save set shortcuts speak |
128 (Cmd) show maxrepeats | 128 ed hi l list orate run say shell show |
129 | |
130 Undocumented commands: | |
131 ====================== | |
132 EOF cmdenvironment eof exit help q quit | |
133 | |
134 (Cmd) help say | |
135 Repeats what you tell me to. | |
136 Usage: speak [options] arg | |
137 | |
138 Options: | |
139 -h, --help show this help message and exit | |
140 -p, --piglatin atinLay | |
141 -s, --shout N00B EMULATION MODE | |
142 -r REPEAT, --repeat=REPEAT | |
143 output [n] times | |
144 | |
145 (Cmd) say goodnight, Gracie | |
146 goodnight, Gracie | |
147 (Cmd) say -ps --repeat=5 goodnight, gracie | |
148 OODNIGHT, GRACIEGAY | |
149 OODNIGHT, GRACIEGAY | |
150 OODNIGHT, GRACIEGAY | |
151 (Cmd) set | |
152 prompt: (Cmd) | |
153 editor: gedit | |
154 echo: False | |
129 maxrepeats: 3 | 155 maxrepeats: 3 |
130 (Cmd) set maxrepeats 5 | 156 (Cmd) set maxrepeats 5 |
131 maxrepeats - was: 3 | 157 maxrepeats - was: 3 |
132 now: 5 | 158 now: 5 |
133 (Cmd) speak --repeat 1000000 softly | 159 (Cmd) say -ps --repeat=5 goodnight, gracie |
134 softly | 160 OODNIGHT, GRACIEGAY |
135 softly | 161 OODNIGHT, GRACIEGAY |
136 softly | 162 OODNIGHT, GRACIEGAY |
137 softly | 163 OODNIGHT, GRACIEGAY |
138 softly | 164 OODNIGHT, GRACIEGAY |
139 (Cmd) orate blah blah | 165 (Cmd) orate these are the |
140 > blah | 166 > times that |
141 > and furthermore | 167 > try mens' souls |
142 > blah | 168 > |
143 > | 169 > |
144 blah blah blah and furthermore blah | 170 these are the times that try mens' souls |
145 (Cmd) &greetings | 171 (Cmd) & we made a shortcut! |
146 greetings | 172 we made a shortcut! |
147 (Cmd) history | 173 (Cmd) history |
148 -------------------------[1] | 174 -------------------------[1] |
149 speak softly | 175 help |
150 -------------------------[2] | 176 -------------------------[2] |
151 speak --piglatin softly | 177 help say |
152 -------------------------[3] | 178 -------------------------[3] |
153 speak -psr 2 softly | 179 say goodnight, Gracie |
154 -------------------------[4] | 180 -------------------------[4] |
155 speak --repeat 1000000 softly | 181 say -ps --repeat=5 goodnight, gracie |
156 -------------------------[5] | 182 -------------------------[5] |
157 show maxrepeats | 183 set |
158 -------------------------[6] | 184 -------------------------[6] |
159 set maxrepeats 5 | 185 set maxrepeats 5 |
160 -------------------------[7] | 186 -------------------------[7] |
161 speak --repeat 1000000 softly | 187 say -ps --repeat=5 goodnight, gracie |
162 -------------------------[8] | 188 -------------------------[8] |
163 orate blah blah | 189 orate these are the |
164 blah | 190 times that |
165 and furthermore | 191 try mens' souls |
166 blah | 192 |
167 | 193 |
168 -------------------------[9] | 194 -------------------------[9] |
169 &greetings | 195 & we made a shortcut! |
170 (Cmd) run | |
171 orate blah blah | |
172 blah | |
173 and furthermore | |
174 blah | |
175 | |
176 blah blah blah and furthermore blah | |
177 (Cmd) run 3 | 196 (Cmd) run 3 |
178 speak -psr 2 softly | 197 say goodnight, Gracie |
179 OFTLYSAY | 198 goodnight, Gracie |
180 OFTLYSAY | 199 (Cmd) say put this in a file > text.txt |
181 (Cmd) history maxrepeats | 200 (Cmd) say < text.txt |
182 -------------------------[5] | 201 put this in a file |
183 set maxrepeats | 202 (Cmd) set prompt "---> " |
184 -------------------------[6] | 203 prompt - was: (Cmd) |
185 set maxrepeats 5 | 204 now: ---> |
186 (Cmd) speak a dead parrot > pet.txt | 205 ---> say goodbye |
187 (Cmd) speak < pet.txt | 206 goodbye |
188 a dead parrot | 207 ---> |
189 (Cmd) speak only resting | wc | |
190 1 2 13 | |
191 (Cmd) |