mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
#5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written at a time where dir() didn't consider base class attributes.
This commit is contained in:
parent
5089a38af2
commit
8904053003
2 changed files with 11 additions and 13 deletions
|
@ -57,15 +57,17 @@ class samplecmdclass(cmd.Cmd):
|
|||
>>> mycmd.completenames("12")
|
||||
[]
|
||||
>>> mycmd.completenames("help")
|
||||
['help', 'help']
|
||||
['help']
|
||||
|
||||
Test for the function complete_help():
|
||||
>>> mycmd.complete_help("a")
|
||||
['add']
|
||||
>>> mycmd.complete_help("he")
|
||||
['help', 'help']
|
||||
['help']
|
||||
>>> mycmd.complete_help("12")
|
||||
[]
|
||||
>>> sorted(mycmd.complete_help(""))
|
||||
['add', 'exit', 'help', 'shell']
|
||||
|
||||
Test for the function do_help():
|
||||
>>> mycmd.do_help("testet")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue