314
|
1 .. cmd2 documentation master file, created by
|
|
2 sphinx-quickstart on Wed Feb 10 12:05:28 2010.
|
|
3 You can adapt this file completely to your liking, but it should at least
|
|
4 contain the root `toctree` directive.
|
|
5
|
358
|
6 cmd2
|
|
7 ====
|
|
8
|
|
9 `cmd2 project page`_
|
|
10
|
|
11 `project bug tracker`_
|
|
12
|
|
13 .. _`cmd2 Project page`: http://www.assembla.com/wiki/show/python-cmd2
|
|
14 .. _`project bug tracker`: http://trac-hg.assembla.com/python-cmd2/report/1
|
314
|
15
|
324
|
16 The basic use of ``cmd2`` is identical to that of cmd_.
|
|
17
|
|
18 1. Create a subclass of ``cmd2.Cmd``. Define attributes and
|
|
19 ``do_*`` methods to control its behavior. Throughout this documentation,
|
|
20 we will assume that you are naming your subclass ``App``::
|
|
21
|
|
22 from cmd2 import Cmd
|
|
23 class App(Cmd):
|
|
24 # customized attributes and methods here
|
|
25
|
|
26 2. Instantiate ``App`` and start the command loop::
|
|
27
|
|
28 app = App()
|
|
29 app.cmdloop()
|
332
|
30
|
|
31 These docs will refer to ``App`` as your ``cmd2.Cmd``
|
|
32 subclass, and ``app`` as an instance of ``App``. Of
|
|
33 course, in your program, you may name them whatever
|
|
34 you want.
|
324
|
35
|
314
|
36 Contents:
|
|
37
|
|
38 .. toctree::
|
|
39 :maxdepth: 2
|
|
40
|
|
41 overview
|
|
42 example
|
|
43 freefeatures
|
315
|
44 settingchanges
|
|
45 unfreefeatures
|
314
|
46
|
|
47 Indices and tables
|
|
48 ==================
|
|
49
|
|
50 * :ref:`genindex`
|
|
51 * :ref:`modindex`
|
|
52 * :ref:`search`
|
|
53
|