Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69013d0

Browse files
committed
- document the termination condition for cmd.Cmd.cmdloop()
- document the use of the return value for cmd.Cmd.do_*() methods
1 parent 479b7a7 commit 69013d0

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Doc/lib/libcmd.tex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ \subsection{Cmd Objects}
6060
beginning with the character \character{!} is dispatched to the
6161
method \method{do_shell()} (if such a method is defined).
6262

63+
This method will return when the \method{postcmd()} method returns a
64+
true value. The \var{stop} argument to \method{postcmd()} is the
65+
return value from the command's corresponding \method{do_*()} method.
66+
6367
If completion is enabled, completing commands will be done
6468
automatically, and completing of commands args is done by calling
6569
\method{complete_foo()} with arguments \var{text}, \var{line},
@@ -83,7 +87,10 @@ \subsection{Cmd Objects}
8387
prompt. This may be overridden, but should not normally need to be;
8488
see the \method{precmd()} and \method{postcmd()} methods for useful
8589
execution hooks. The return value is a flag indicating whether
86-
interpretation of commands by the interpreter should stop.
90+
interpretation of commands by the interpreter should stop. If there
91+
is a \method{do_*()} method for the command \var{str}, the return
92+
value of that method is returned, otherwise the return value from the
93+
\method{default()} method is returned.
8794
\end{methoddesc}
8895

8996
\begin{methoddesc}{emptyline}{}

0 commit comments

Comments
 (0)