summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd2.py b/cmd2.py
index a533bb7a..39522f27 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -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