Mercurial > python-cmd2
annotate docs/freefeatures.rst @ 325:4172feeddf76
want to incorporate run() for tests - not yet working
author | catherine@dellzilla |
---|---|
date | Thu, 11 Feb 2010 17:03:45 -0500 |
parents | 21584174d865 |
children | 7b2bca3951a7 |
rev | line source |
---|---|
314 | 1 =================================== |
2 Features requiring no modifications | |
3 =================================== | |
4 | |
5 These features are provided "for free" to a cmd_-based application | |
6 simply by replacing ``import cmd`` with ``import cmd2 as cmd``. | |
7 | |
315 | 8 Script files |
9 ============ | |
10 | |
325
4172feeddf76
want to incorporate run() for tests - not yet working
catherine@dellzilla
parents:
324
diff
changeset
|
11 Commands can be loaded and run from text files. |
315 | 12 |
13 .. automethod:: cmd2.Cmd.do_load | |
14 | |
325
4172feeddf76
want to incorporate run() for tests - not yet working
catherine@dellzilla
parents:
324
diff
changeset
|
15 .. automethod:: cmd2.Cmd.do_save |
4172feeddf76
want to incorporate run() for tests - not yet working
catherine@dellzilla
parents:
324
diff
changeset
|
16 |
315 | 17 Output redirection |
18 ================== | |
19 | |
324 | 20 As in a Unix shell, output of a command can be redirected: |
21 | |
22 - sent to a file with ``>``, as in ``mycommand args > filename.txt`` | |
23 - piped (``|``) as input to operating-system commands, as in | |
24 ``mycommand args | wc`` | |
25 - sent to the paste buffer, ready for the next Copy operation, by | |
26 ending with a bare ``>``, as in ``mycommand args >``.. Redirecting | |
27 to paste buffer requires software to be installed on the operating | |
28 system, pywin32_ on Windows or xclip_ on *nix. | |
29 | |
30 .. _pywin32:: http://sourceforge.net/projects/pywin32/ | |
31 .. _xclip:: http://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/ | |
32 | |
33 | |
325
4172feeddf76
want to incorporate run() for tests - not yet working
catherine@dellzilla
parents:
324
diff
changeset
|
34 Commands at invocation |
4172feeddf76
want to incorporate run() for tests - not yet working
catherine@dellzilla
parents:
324
diff
changeset
|
35 ====================== |
324 | 36 |
325
4172feeddf76
want to incorporate run() for tests - not yet working
catherine@dellzilla
parents:
324
diff
changeset
|
37 TODO: broken!? |
315 | 38 |
39 Python | |
40 ====== | |
41 | |
314 | 42 Searchable command history |
43 ========================== | |
44 | |
45 All cmd_-based applications have access to previous commands with | |
46 the up- and down- cursor keys. | |
47 | |
48 All cmd_-based applications on systems with the ``readline`` module | |
49 also provide `bash-like history list editing`_. | |
50 | |
51 .. _`bash-like history list editing`: http://www.talug.org/events/20030709/cmdline_history.html | |
52 | |
53 ``cmd2`` makes a third type of history access available, consisting of these commands: | |
54 | |
55 .. automethod:: cmd2.Cmd.do_history | |
56 | |
315 | 57 Transcript-based testing |
58 ======================== |