From: Raymond Hettinger Date: Thu, 9 Sep 2010 03:53:22 +0000 (+0000) Subject: Add docstring to cmd.Cmd.do_help() X-Git-Tag: v3.2a3~367 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44d7b6ad60c151d2a265c326c1f7cf26d3c9dc18;p=thirdparty%2FPython%2Fcpython.git Add docstring to cmd.Cmd.do_help() --- diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst index b72a49f167b8..d713b8f6dc32 100644 --- a/Doc/library/cmd.rst +++ b/Doc/library/cmd.rst @@ -312,10 +312,6 @@ blank lines to repeat commands, and the simple record and playback facility:: bye color goto home playback record right circle forward heading left position reset undo - Undocumented commands: - ====================== - help - (turtle) help forward Move the turtle forward by the specified distance: FORWARD 10 (turtle) record spiral.cmd diff --git a/Lib/cmd.py b/Lib/cmd.py index 85282f89a6b3..8fa7d019b550 100644 --- a/Lib/cmd.py +++ b/Lib/cmd.py @@ -288,6 +288,7 @@ class Cmd: return list(commands | topics) def do_help(self, arg): + 'List available commands with "help" or detailed help with "help cmd".' if arg: # XXX check arg syntax try: diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py index 75aa6bbd1a1b..a1799f915fe3 100644 --- a/Lib/test/test_cmd.py +++ b/Lib/test/test_cmd.py @@ -84,11 +84,11 @@ class samplecmdclass(cmd.Cmd): Documented commands (type help ): ======================================== - add + add help Undocumented commands: ====================== - exit help shell + exit shell Test for the function print_topics(): @@ -125,11 +125,11 @@ class samplecmdclass(cmd.Cmd): Documented commands (type help ): ======================================== - add + add help Undocumented commands: ====================== - exit help shell + exit shell help text for add Hello from postloop