comparison docs/freefeatures.rst @ 388:52ab96d4f179

fix some Sphinx warnings
author anatoly techtonik <techtonik@gmail.com>
date Mon, 21 Jun 2010 17:02:20 +0300
parents 49dd1ce6cfd6
children e60e2c15f026
comparison
equal deleted inserted replaced
387:43ce9110d5a6 388:52ab96d4f179
2 Features requiring no modifications 2 Features requiring no modifications
3 =================================== 3 ===================================
4 4
5 These features are provided "for free" to a cmd_-based application 5 These features are provided "for free" to a cmd_-based application
6 simply by replacing ``import cmd`` with ``import cmd2 as cmd``. 6 simply by replacing ``import cmd`` with ``import cmd2 as cmd``.
7
8 .. _cmd: http://docs.python.org/library/cmd.html#module-cmd
7 9
8 Script files 10 Script files
9 ============ 11 ============
10 12
11 Text files can serve as scripts for your ``cmd2``-based 13 Text files can serve as scripts for your ``cmd2``-based
26 default, both Python-style and C-style comments 28 default, both Python-style and C-style comments
27 are recognized; you may change this by overriding 29 are recognized; you may change this by overriding
28 ``app.commentGrammars`` with a different pyparsing_ 30 ``app.commentGrammars`` with a different pyparsing_
29 grammar. 31 grammar.
30 32
31 Comments can be useful in :ref:`script`s. Used 33 Comments can be useful in :ref:`scripts`. Used
32 in an interactive session, they may indicate 34 in an interactive session, they may indicate
33 mental imbalance. 35 mental imbalance.
34 36
35 :: 37 ::
36 38
39 41
40 :: 42 ::
41 43
42 (Cmd) speak it was /* not */ delicious! # Yuck! 44 (Cmd) speak it was /* not */ delicious! # Yuck!
43 it was delicious! 45 it was delicious!
46
47 .. _pyparsing: http://pyparsing.wikispaces.com/
44 48
45 Commands at invocation 49 Commands at invocation
46 ====================== 50 ======================
47 51
48 You can send commands to your app as you invoke it by 52 You can send commands to your app as you invoke it by
68 - piped (``|``) as input to operating-system commands, as in 72 - piped (``|``) as input to operating-system commands, as in
69 ``mycommand args | wc`` 73 ``mycommand args | wc``
70 - sent to the paste buffer, ready for the next Copy operation, by 74 - sent to the paste buffer, ready for the next Copy operation, by
71 ending with a bare ``>``, as in ``mycommand args >``.. Redirecting 75 ending with a bare ``>``, as in ``mycommand args >``.. Redirecting
72 to paste buffer requires software to be installed on the operating 76 to paste buffer requires software to be installed on the operating
73 system, pywin32_ on Windows or xclip_ on *nix. 77 system, pywin32_ on Windows or xclip_ on \*nix.
74 78
75 .. _pywin32:: http://sourceforge.net/projects/pywin32/ 79 .. _pywin32: http://sourceforge.net/projects/pywin32/
76 .. _xclip:: http://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/ 80 .. _xclip: http://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/
77 81
78 Python 82 Python
79 ====== 83 ======
80
81 ::
82 84
83 The ``py`` command will run its arguments as a Python 85 The ``py`` command will run its arguments as a Python
84 command. Entered without arguments, it enters an 86 command. Entered without arguments, it enters an
85 interactive Python session. That session can call 87 interactive Python session. That session can call
86 "back" to your application with ``cmd("")``. Through 88 "back" to your application with ``cmd("")``. Through