Commit 44d7b6ad authored by Raymond Hettinger's avatar Raymond Hettinger

Add docstring to cmd.Cmd.do_help()

parent bd889e8c
...@@ -312,10 +312,6 @@ blank lines to repeat commands, and the simple record and playback facility:: ...@@ -312,10 +312,6 @@ blank lines to repeat commands, and the simple record and playback facility::
bye color goto home playback record right bye color goto home playback record right
circle forward heading left position reset undo circle forward heading left position reset undo
Undocumented commands:
======================
help
(turtle) help forward (turtle) help forward
Move the turtle forward by the specified distance: FORWARD 10 Move the turtle forward by the specified distance: FORWARD 10
(turtle) record spiral.cmd (turtle) record spiral.cmd
......
...@@ -288,6 +288,7 @@ class Cmd: ...@@ -288,6 +288,7 @@ class Cmd:
return list(commands | topics) return list(commands | topics)
def do_help(self, arg): def do_help(self, arg):
'List available commands with "help" or detailed help with "help cmd".'
if arg: if arg:
# XXX check arg syntax # XXX check arg syntax
try: try:
......
...@@ -84,11 +84,11 @@ class samplecmdclass(cmd.Cmd): ...@@ -84,11 +84,11 @@ class samplecmdclass(cmd.Cmd):
<BLANKLINE> <BLANKLINE>
Documented commands (type help <topic>): Documented commands (type help <topic>):
======================================== ========================================
add add help
<BLANKLINE> <BLANKLINE>
Undocumented commands: Undocumented commands:
====================== ======================
exit help shell exit shell
<BLANKLINE> <BLANKLINE>
Test for the function print_topics(): Test for the function print_topics():
...@@ -125,11 +125,11 @@ class samplecmdclass(cmd.Cmd): ...@@ -125,11 +125,11 @@ class samplecmdclass(cmd.Cmd):
<BLANKLINE> <BLANKLINE>
Documented commands (type help <topic>): Documented commands (type help <topic>):
======================================== ========================================
add add help
<BLANKLINE> <BLANKLINE>
Undocumented commands: Undocumented commands:
====================== ======================
exit help shell exit shell
<BLANKLINE> <BLANKLINE>
help text for add help text for add
Hello from postloop Hello from postloop
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment