summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-07-30 18:58:54 (GMT)
committerFred Drake <fdrake@acm.org>2004-07-30 18:58:54 (GMT)
commit69013d070ead4e936f0acb3919a8dcc28c380b63 (patch)
tree2fbd9d10b08bae8f9d7d1206df43ed248afa2450 /Doc
parent479b7a7cdbcba88227b79cf10d207db5b5b7e58a (diff)
downloadcpython-69013d070ead4e936f0acb3919a8dcc28c380b63.zip
cpython-69013d070ead4e936f0acb3919a8dcc28c380b63.tar.gz
cpython-69013d070ead4e936f0acb3919a8dcc28c380b63.tar.bz2
- document the termination condition for cmd.Cmd.cmdloop()
- document the use of the return value for cmd.Cmd.do_*() methods
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libcmd.tex9
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/lib/libcmd.tex b/Doc/lib/libcmd.tex
index 7260b85..ce01d24 100644
--- a/Doc/lib/libcmd.tex
+++ b/Doc/lib/libcmd.tex
@@ -60,6 +60,10 @@ the method \method{do_help()}. As another special case, a line
beginning with the character \character{!} is dispatched to the
method \method{do_shell()} (if such a method is defined).
+This method will return when the \method{postcmd()} method returns a
+true value. The \var{stop} argument to \method{postcmd()} is the
+return value from the command's corresponding \method{do_*()} method.
+
If completion is enabled, completing commands will be done
automatically, and completing of commands args is done by calling
\method{complete_foo()} with arguments \var{text}, \var{line},
@@ -83,7 +87,10 @@ Interpret the argument as though it had been typed in response to the
prompt. This may be overridden, but should not normally need to be;
see the \method{precmd()} and \method{postcmd()} methods for useful
execution hooks. The return value is a flag indicating whether
-interpretation of commands by the interpreter should stop.
+interpretation of commands by the interpreter should stop. If there
+is a \method{do_*()} method for the command \var{str}, the return
+value of that method is returned, otherwise the return value from the
+\method{default()} method is returned.
\end{methoddesc}
\begin{methoddesc}{emptyline}{}