annotate Doc/lib/libcmd.tex @ 21467:4e35fa5d5708 legacy-trunk

Add documentation for the help() built-in; contributed by Ka-Ping Yee. This is part of SF patch #494622.
author Fred Drake <fdrake@acm.org>
date Tue, 18 Dec 2001 16:31:08 +0000
parents ae19c6990749
children 58a82a4be8b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
1 \section{\module{cmd} ---
15142
563dee598d3a Fixed lots of small nits caught by Ka-Ping Yee <ping@lfw.org>.
Fred Drake <fdrake@acm.org>
parents: 13560
diff changeset
2 Support for line-oriented command interpreters}
563dee598d3a Fixed lots of small nits caught by Ka-Ping Yee <ping@lfw.org>.
Fred Drake <fdrake@acm.org>
parents: 13560
diff changeset
3
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8619
diff changeset
4 \declaremodule{standard}{cmd}
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
5 \sectionauthor{Eric S. Raymond}{esr@snark.thyrsus.com}
15142
563dee598d3a Fixed lots of small nits caught by Ka-Ping Yee <ping@lfw.org>.
Fred Drake <fdrake@acm.org>
parents: 13560
diff changeset
6 \modulesynopsis{Build line-oriented command interpreters.}
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 8619
diff changeset
7
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
8
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
9 The \class{Cmd} class provides a simple framework for writing
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 line-oriented command interpreters. These are often useful for
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 test harnesses, administrative tools, and prototypes that will
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 later be wrapped in a more sophisticated interface.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
13
18855
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
14 \begin{classdesc}{Cmd}{\optional{completekey}}
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 A \class{Cmd} instance or subclass instance is a line-oriented
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
16 interpreter framework. There is no good reason to instantiate
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
17 \class{Cmd} itself; rather, it's useful as a superclass of an
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
18 interpreter class you define yourself in order to inherit
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
19 \class{Cmd}'s methods and encapsulate action methods.
18855
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
20
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
21 The optional argument is the \refmodule{readline} name of a completion
18860
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
22 key; it defaults to \kbd{Tab}. If \var{completekey} is not \code{None}
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
23 and \module{readline} is available, command completion is done
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
24 automatically.
18855
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
25
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 \end{classdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
27
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 \subsection{Cmd Objects}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 \label{Cmd-objects}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
30
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 A \class{Cmd} instance has the following methods:
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
32
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
33 \begin{methoddesc}{cmdloop}{\optional{intro}}
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 Repeatedly issue a prompt, accept input, parse an initial prefix off
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 the received input, and dispatch to action methods, passing them the
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 remainder of the line as argument.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
37
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 The optional argument is a banner or intro string to be issued before the
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 first prompt (this overrides the \member{intro} class member).
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 If the \module{readline} module is loaded, input will automatically
18488
9977cf206532 Follow the recommended practices for keystroke representation; this
Fred Drake <fdrake@acm.org>
parents: 18244
diff changeset
42 inherit \program{bash}-like history-list editing (e.g. \kbd{Control-P}
9977cf206532 Follow the recommended practices for keystroke representation; this
Fred Drake <fdrake@acm.org>
parents: 18244
diff changeset
43 scrolls back to the last command, \kbd{Control-N} forward to the next
9977cf206532 Follow the recommended practices for keystroke representation; this
Fred Drake <fdrake@acm.org>
parents: 18244
diff changeset
44 one, \kbd{Control-F} moves the cursor to the right non-destructively,
9977cf206532 Follow the recommended practices for keystroke representation; this
Fred Drake <fdrake@acm.org>
parents: 18244
diff changeset
45 \kbd{Control-B} moves the cursor to the left non-destructively, etc.).
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
46
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
47 An end-of-file on input is passed back as the string \code{'EOF'}.
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
48
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
49 An interpreter instance will recognize a command name \samp{foo} if
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
50 and only if it has a method \method{do_foo()}. As a special case,
13560
6987e9450619 Resynchronize the TeX docs with (a) the module docstring, and (b) my recent
Eric S. Raymond <esr@thyrsus.com>
parents: 8918
diff changeset
51 a line beginning with the character \character{?} is dispatched to
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
52 the method \method{do_help()}. As another special case, a line
13560
6987e9450619 Resynchronize the TeX docs with (a) the module docstring, and (b) my recent
Eric S. Raymond <esr@thyrsus.com>
parents: 8918
diff changeset
53 beginning with the character \character{!} is dispatched to the
18860
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
54 method \method{do_shell()} (if such a method is defined).
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
55
18855
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
56 If completion is enabled, completing commands will be done
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
57 automatically, and completing of commands args is done by calling
18860
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
58 \method{complete_foo()} with arguments \var{text}, \var{line},
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
59 \var{begidx}, and \var{endidx}. \var{text} is the string prefix we
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
60 are attempting to match: all returned matches must begin with it.
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
61 \var{line} is the current input line with leading whitespace removed,
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
62 \var{begidx} and \var{endidx} are the beginning and ending indexes
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
63 of the prefix text, which could be used to provide different
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
64 completion depending upon which position the argument is in.
18855
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
65
18860
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
66 All subclasses of \class{Cmd} inherit a predefined \method{do_help()}.
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
67 This method, called with an argument \code{'bar'}, invokes the
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
68 corresponding method \method{help_bar()}. With no argument,
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
69 \method{do_help()} lists all available help topics (that is, all
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
70 commands with corresponding \method{help_*()} methods), and also lists
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
71 any undocumented commands.
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
72 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
73
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
74 \begin{methoddesc}{onecmd}{str}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
75 Interpret the argument as though it had been typed in in
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
76 response to the prompt.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
77 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
78
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
79 \begin{methoddesc}{emptyline}{}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
80 Method called when an empty line is entered in response to the prompt.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
81 If this method is not overridden, it repeats the last nonempty command
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
82 entered.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
83 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
84
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
85 \begin{methoddesc}{default}{line}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
86 Method called on an input line when the command prefix is not
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
87 recognized. If this method is not overridden, it prints an
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
88 error message and returns.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
89 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
90
18855
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
91 \begin{methoddesc}{completedefault}{text, line, begidx, endidx}
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
92 Method called to complete an input line when no command-specific
18860
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
93 \method{complete_*()} method is available. By default, it returns an
18855
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
94 empty list.
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
95 \end{methoddesc}
6f301b3cf323 Patch #416224: add readline completion to cmd.Cmd.
Martin v. Löwis <martin@v.loewis.de>
parents: 18488
diff changeset
96
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
97 \begin{methoddesc}{precmd}{}
18244
24c29b371510 Correct erroneous description of precmd.
Eric S. Raymond <esr@thyrsus.com>
parents: 17218
diff changeset
98 Hook method executed just before the command line is interpreted, but
24c29b371510 Correct erroneous description of precmd.
Eric S. Raymond <esr@thyrsus.com>
parents: 17218
diff changeset
99 after the input prompt is generated and issued. This
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
100 method is a stub in \class{Cmd}; it exists to be overridden by
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
101 subclasses.
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
102 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
103
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
104 \begin{methoddesc}{postcmd}{}
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
105 Hook method executed just after a command dispatch is finished. This
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
106 method is a stub in \class{Cmd}; it exists to be overridden by
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
107 subclasses.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
108 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
109
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
110 \begin{methoddesc}{preloop}{}
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
111 Hook method executed once when \method{cmdloop()} is called. This
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
112 method is a stub in \class{Cmd}; it exists to be overridden by
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
113 subclasses.
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
114 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
115
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
116 \begin{methoddesc}{postloop}{}
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
117 Hook method executed once when \method{cmdloop()} is about to return.
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
118 This method is a stub in \class{Cmd}; it exists to be overridden by
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
119 subclasses.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
120 \end{methoddesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
121
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
122 Instances of \class{Cmd} subclasses have some public instance variables:
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
123
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
124 \begin{memberdesc}{prompt}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
125 The prompt issued to solicit input.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
126 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
127
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
128 \begin{memberdesc}{identchars}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
129 The string of characters accepted for the command prefix.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
130 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
131
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
132 \begin{memberdesc}{lastcmd}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
133 The last nonempty command prefix seen.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
134 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
135
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
136 \begin{memberdesc}{intro}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
137 A string to issue as an intro or banner. May be overridden by giving
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
138 the \method{cmdloop()} method an argument.
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
139 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
140
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
141 \begin{memberdesc}{doc_header}
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
142 The header to issue if the help output has a section for documented
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
143 commands.
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
144 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
145
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
146 \begin{memberdesc}{misc_header}
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
147 The header to issue if the help output has a section for miscellaneous
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
148 help topics (that is, there are \method{help_*()} methods without
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
149 corresponding \method{do_*()} methods).
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
150 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
151
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
152 \begin{memberdesc}{undoc_header}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
153 The header to issue if the help output has a section for undocumented
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
154 commands (that is, there are \method{do_*()} methods without
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
155 corresponding \method{help_*()} methods).
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
156 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
157
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 \begin{memberdesc}{ruler}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
159 The character used to draw separator lines under the help-message
8619
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
160 headers. If empty, no ruler line is drawn. It defaults to
6ed503d9c3d5 Normalize the markup.
Fred Drake <fdrake@acm.org>
parents: 8572
diff changeset
161 \character{=}.
8572
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
162 \end{memberdesc}
ea8f0f5ab015 Contributions by Eric Raymond: documentation for modules
Guido van Rossum <guido@python.org>
parents:
diff changeset
163
17218
b3dce06868d6 Document use_rawinput. (Although now that I think more about it, a
Guido van Rossum <guido@python.org>
parents: 15142
diff changeset
164 \begin{memberdesc}{use_rawinput}
b3dce06868d6 Document use_rawinput. (Although now that I think more about it, a
Guido van Rossum <guido@python.org>
parents: 15142
diff changeset
165 A flag, defaulting to true. If true, \method{cmdloop()} uses
b3dce06868d6 Document use_rawinput. (Although now that I think more about it, a
Guido van Rossum <guido@python.org>
parents: 15142
diff changeset
166 \function{raw_input()} to display a prompt and read the next command;
18860
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
167 if false, \method{sys.stdout.write()} and
ae19c6990749 Make some adjustments to the markup, and fix up some style-guide issues.
Fred Drake <fdrake@acm.org>
parents: 18855
diff changeset
168 \method{sys.stdin.readline()} are used. (This means that by
18244
24c29b371510 Correct erroneous description of precmd.
Eric S. Raymond <esr@thyrsus.com>
parents: 17218
diff changeset
169 importing \module{readline}, on systems that support it, the
24c29b371510 Correct erroneous description of precmd.
Eric S. Raymond <esr@thyrsus.com>
parents: 17218
diff changeset
170 interpreter will automatically support Emacs-like line editing
24c29b371510 Correct erroneous description of precmd.
Eric S. Raymond <esr@thyrsus.com>
parents: 17218
diff changeset
171 and command-history keystrokes.)
17218
b3dce06868d6 Document use_rawinput. (Although now that I think more about it, a
Guido van Rossum <guido@python.org>
parents: 15142
diff changeset
172 \end{memberdesc}