summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-27 23:03:35 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-27 23:03:35 -0400
commit554561b70f899ad8ec38393b27eed646456cab62 (patch)
tree197a5f86b09b0e176ff57831088c9e5cdb9a62f8 /docs
parent88ce0b509dc09233a7c3efca7f1bea8b2c6c1ae2 (diff)
downloadcmd2-git-554561b70f899ad8ec38393b27eed646456cab62.tar.gz
Addressed code review comments
Diffstat (limited to 'docs')
-rw-r--r--docs/freefeatures.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/freefeatures.rst b/docs/freefeatures.rst
index d700d144..8255868c 100644
--- a/docs/freefeatures.rst
+++ b/docs/freefeatures.rst
@@ -345,3 +345,8 @@ which inherits from ``cmd2.Cmd``::
# Make sure you have an "import functools" somewhere at the top
complete_bar = functools.partialmethod(cmd2.Cmd.path_complete, dir_only=True)
+
+ # Since Python 2 does not have functools.partialmethod(), you can achieve the
+ # same thing by implementing a tab completion function
+ def complete_bar(self, text, line, begidx, endidx):
+ return self.path_complete(text, line, begidx, endidx, dir_only=True)