@@ -3,25 +3,25 @@ \section{Standard Module \module{cmd}}
33\stmodindex {cmd}
44\label {module-cmd }
55
6- The \code {Cmd} class provides a simple framework for writing
6+ The \class {Cmd} class provides a simple framework for writing
77line-oriented command interpreters. These are often useful for
88test harnesses, administrative tools, and prototypes that will
99later be wrapped in a more sophisticated interface.
1010
1111\begin {classdesc }{Cmd}{}
1212A \class {Cmd} instance or subclass instance is a line-oriented
13- interpreter framework. There is no good reason to instantiate Cmd
14- itself; rather, it's useful as a superclass of an interpreter class
15- you define yourself in order to inherit Cmd's methods and encapsulate
16- action functions .
13+ interpreter framework. There is no good reason to instantiate
14+ \class {Cmd} itself; rather, it's useful as a superclass of an
15+ interpreter class you define yourself in order to inherit
16+ \class {Cmd}'s methods and encapsulate action methods .
1717\end {classdesc }
1818
1919\subsection {Cmd Objects }
2020\label {Cmd-objects }
2121
2222A \class {Cmd} instance has the following methods:
2323
24- \begin {methoddesc }{cmdloop}{intro}
24+ \begin {methoddesc }{cmdloop}{\optional { intro} }
2525Repeatedly issue a prompt, accept input, parse an initial prefix off
2626the received input, and dispatch to action methods, passing them the
2727remainder of the line as argument.
@@ -30,26 +30,26 @@ \subsection{Cmd Objects}
3030first prompt (this overrides the \member {intro} class member).
3131
3232If the \module {readline} module is loaded, input will automatically
33- inherit Emacs -like history-list editing (e.g. Ctrl-P scrolls back to
34- the last command, Ctrl-N forward to the next one, Ctrl-F moves the
35- cursor to the right non-destructively, Ctrl-B moves the cursor to the
36- left non-destructively, etc.).
33+ inherit \program {bash} -like history-list editing (e.g. \kbd { Ctrl-P}
34+ scrolls back to the last command, \kbd { Ctrl-N} forward to the next
35+ one, \kbd { Ctrl-F} moves the cursor to the right non-destructively,
36+ \kbd {Ctrl-B} moves the cursor to the left non-destructively, etc.).
3737
38- An end-of-file on input is passed back as the string " EOF" .
38+ An end-of-file on input is passed back as the string \code {' EOF'} .
3939
40- An interpreter instance will recognize a command name \code {foo} if
41- and only if it has a method named \method {do_foo}. As a special case,
42- a line containing only the character `?' is dispatched to the method
43- \method {do_help}. As another special case, a line containing only the
44- character `!' is dispatched to the method \method {do_shell} (if such a method
45- is defined).
40+ An interpreter instance will recognize a command name \samp {foo} if
41+ and only if it has a method \method {do_foo() }. As a special case,
42+ a line containing only the character \character {?} is dispatched to
43+ the method \method {do_help() }. As another special case, a line
44+ containing only the character \character {!} is dispatched to the
45+ method \method {do_shell} (if such a method is defined).
4646
4747All subclasses of \class {Cmd} inherit a predefined \method {do_help}.
4848This method, called with an argument \code {bar}, invokes the
49- corresponding method \method {help_bar}. With no argument,
50- \method {do_help} lists all available help topics (that is, all
51- commands with corresponding \code {help_} methods), and also lists any
52- undocumented commands.
49+ corresponding method \method {help_bar() }. With no argument,
50+ \method {do_help() } lists all available help topics (that is, all
51+ commands with corresponding \method {help_*() } methods), and also lists
52+ any undocumented commands.
5353\end {methoddesc }
5454
5555\begin {methoddesc }{onecmd}{str}
@@ -69,25 +69,27 @@ \subsection{Cmd Objects}
6969error message and returns.
7070\end {methoddesc }
7171
72- \begin {methoddesc }{precmd}
73- Hook method executed just before the input prompt is issued. This method is
74- a stub in \class {Cmd}; it exists to be overridden by subclasses.
72+ \begin {methoddesc }{precmd}{}
73+ Hook method executed just before the input prompt is issued. This
74+ method is a stub in \class {Cmd}; it exists to be overridden by
75+ subclasses.
7576\end {methoddesc }
7677
77- \begin {methoddesc }{postcmd}
78+ \begin {methoddesc }{postcmd}{}
7879Hook method executed just after a command dispatch is finished. This
7980method is a stub in \class {Cmd}; it exists to be overridden by
8081subclasses.
8182\end {methoddesc }
8283
83- \begin {methoddesc }{preloop}
84- Hook method executed once when \method {cmdloop()} is called. This method is
85- a stub in \class {Cmd}; it exists to be overridden by subclasses.
84+ \begin {methoddesc }{preloop}{}
85+ Hook method executed once when \method {cmdloop()} is called. This
86+ method is a stub in \class {Cmd}; it exists to be overridden by
87+ subclasses.
8688\end {methoddesc }
8789
88- \begin {methoddesc }{postloop}
89- Hook method executed once when \method {cmdloop()} is about to return. This
90- method is a stub in \class {Cmd}; it exists to be overridden by
90+ \begin {methoddesc }{postloop}{}
91+ Hook method executed once when \method {cmdloop()} is about to return.
92+ This method is a stub in \class {Cmd}; it exists to be overridden by
9193subclasses.
9294\end {methoddesc }
9395
@@ -111,24 +113,26 @@ \subsection{Cmd Objects}
111113\end {memberdesc }
112114
113115\begin {memberdesc }{doc_header}
114- The header to issue if the help output has a section for documented commands.
116+ The header to issue if the help output has a section for documented
117+ commands.
115118\end {memberdesc }
116119
117120\begin {memberdesc }{misc_header}
118- The header to issue if the help output has a section for miscellaneous
119- help topics (that is, there are \code {help_} methods withoud corresponding
120- \code {do_} functions ).
121+ The header to issue if the help output has a section for miscellaneous
122+ help topics (that is, there are \method {help_*() } methods without
123+ corresponding \method {do_*()} methods ).
121124\end {memberdesc }
122125
123126\begin {memberdesc }{undoc_header}
124127The header to issue if the help output has a section for undocumented
125- commands (that is, there are \code {do_} methods withoud corresponding
126- \code {help_} functions ).
128+ commands (that is, there are \method {do_*() } methods without
129+ corresponding \method {help_*()} methods ).
127130\end {memberdesc }
128131
129132\begin {memberdesc }{ruler}
130133The character used to draw separator lines under the help-message
131- headers. If empty, no ruler line is drawn. It defaults to "=" .
134+ headers. If empty, no ruler line is drawn. It defaults to
135+ \character {=}.
132136\end {memberdesc }
133137
134138
0 commit comments