@@ -19,9 +19,9 @@ \section{\module{cmd} ---
1919\class {Cmd}'s methods and encapsulate action methods.
2020
2121The optional argument is the \refmodule {readline} name of a completion
22- key; it defaults to \code { `` tab '' }. If \var {completekey} is not
23- \code {None} and \module {readline} is available, command completion is
24- done automatically.
22+ key; it defaults to \kbd {Tab }. If \var {completekey} is not \code {None}
23+ and \module {readline} is available, command completion is done
24+ automatically.
2525
2626\end {classdesc }
2727
@@ -51,20 +51,20 @@ \subsection{Cmd Objects}
5151a line beginning with the character \character {?} is dispatched to
5252the method \method {do_help()}. As another special case, a line
5353beginning with the character \character {!} is dispatched to the
54- method \method {do_shell} (if such a method is defined).
54+ method \method {do_shell() } (if such a method is defined).
5555
5656If completion is enabled, completing commands will be done
5757automatically, and completing of commands args is done by calling
58- \method {complete_foo()} with arguments \samp {text}, \samp {line},
59- \samp {begidx}, \samp {endidx}. \samp {text} is string we are matching
60- against, all returned matches must begin with it. \samp {line} is the
61- current input line (lstripped), \samp {begidx} and \samp {endidx} are
62- the beginning and end indexes of the text being matched, which could
63- be used to provide different completion depending upon which position
64- the argument is in.
65-
66- All subclasses of \class {Cmd} inherit a predefined \method {do_help}.
67- This method, called with an argument \code {bar}, invokes the
58+ \method {complete_foo()} with arguments \var {text}, \var {line},
59+ \var {begidx}, and \var {endidx}. \var {text} is the string prefix we
60+ are attempting to match: all returned matches must begin with it.
61+ \var {line} is the current input line with leading whitespace removed,
62+ \var {begidx} and \var {endidx} are the beginning and ending indexes
63+ of the prefix text, which could be used to provide different
64+ completion depending upon which position the argument is in.
65+
66+ All subclasses of \class {Cmd} inherit a predefined \method {do_help() }.
67+ This method, called with an argument \code {' bar' }, invokes the
6868corresponding method \method {help_bar()}. With no argument,
6969\method {do_help()} lists all available help topics (that is, all
7070commands with corresponding \method {help_*()} methods), and also lists
@@ -90,7 +90,7 @@ \subsection{Cmd Objects}
9090
9191\begin {methoddesc }{completedefault}{text, line, begidx, endidx}
9292Method called to complete an input line when no command-specific
93- \code {complete_} method is available. By default, it returns an
93+ \method {complete_*() } method is available. By default, it returns an
9494empty list.
9595\end {methoddesc }
9696
@@ -164,8 +164,8 @@ \subsection{Cmd Objects}
164164\begin {memberdesc }{use_rawinput}
165165A flag, defaulting to true. If true, \method {cmdloop()} uses
166166\function {raw_input()} to display a prompt and read the next command;
167- if false, \function {sys.stdout.write()} and
168- \function {sys.stdin.readline()} are used. (This means that by
167+ if false, \method {sys.stdout.write()} and
168+ \method {sys.stdin.readline()} are used. (This means that by
169169importing \module {readline}, on systems that support it, the
170170interpreter will automatically support Emacs-like line editing
171171and command-history keystrokes.)
0 commit comments