diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-20 18:04:43 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-20 18:04:43 -0500 |
commit | bd948d727e0e13fa5fd77199c06fcd3dfdda9b39 (patch) | |
tree | bbb7ae35cb76becccddfe7dd4258c87b2c463b68 /cmd2.py | |
parent | 5550ab73a91d2834e6bda72eb3889998ad59be51 (diff) | |
download | cmd2-git-bd948d727e0e13fa5fd77199c06fcd3dfdda9b39.tar.gz |
Added unit tests for newly-overridden complete() method
Also added a section on Sub-commands to the documentation.
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -803,6 +803,14 @@ class Cmd(cmd.Cmd): If a command has not been entered, then complete against command list. Otherwise try to call complete_<command> to get list of completions. + + This method gets called directly by readline because it is set as the tab-completion function. + + This completer function is called as complete(text, state), for state in 0, 1, 2, …, until it returns a + non-string value. It should return the next possible completion starting with text. + + :param text: str - the current word that user is typing + :param state: int - non-negative integer """ if state == 0: import readline |