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
|
|
6 Welcome to cmd2's documentation!
|
|
7 ================================
|
|
8
|
324
|
9 The basic use of ``cmd2`` is identical to that of cmd_.
|
|
10
|
|
11 1. Create a subclass of ``cmd2.Cmd``. Define attributes and
|
|
12 ``do_*`` methods to control its behavior. Throughout this documentation,
|
|
13 we will assume that you are naming your subclass ``App``::
|
|
14
|
|
15 from cmd2 import Cmd
|
|
16 class App(Cmd):
|
|
17 # customized attributes and methods here
|
|
18
|
|
19 2. Instantiate ``App`` and start the command loop::
|
|
20
|
|
21 app = App()
|
|
22 app.cmdloop()
|
332
|
23
|
|
24 These docs will refer to ``App`` as your ``cmd2.Cmd``
|
|
25 subclass, and ``app`` as an instance of ``App``. Of
|
|
26 course, in your program, you may name them whatever
|
|
27 you want.
|
324
|
28
|
314
|
29 Contents:
|
|
30
|
|
31 .. toctree::
|
|
32 :maxdepth: 2
|
|
33
|
|
34 overview
|
|
35 example
|
|
36 freefeatures
|
315
|
37 settingchanges
|
|
38 unfreefeatures
|
314
|
39
|
|
40 Indices and tables
|
|
41 ==================
|
|
42
|
|
43 * :ref:`genindex`
|
|
44 * :ref:`modindex`
|
|
45 * :ref:`search`
|
|
46
|