Name
onecmd
Synopsis
c.onecmd(s)
c
.cmdloop calls
c
.onecmd(
s
)
for each command line s that the user
inputs. You can also call onecmd directly, if you
have independently obtained a line s that
you need to process as a command. Normally, subclasses do not
override method onecmd.
Cmd.onecmd unconditionally sets
c
.lastcmd=
s.
Then, onecmd calls
do_
verb if
s starts with the word
verb and if the subclass supplies such a
method, or else methods emptyline or
default, as explained earlier. In any case,
Cmd.onecmd returns the result of whatever other
method it ends up calling, to be interpreted by
postcmd as a termination-request flag.