summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-05 21:18:47 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-05 21:18:47 -0500
commitde12ee4782799350233be7adadeac08907c13e84 (patch)
tree27fc7fe3d9ce11913cb0a819f05f28c79fd0bf7d /cmd2/utils.py
parent9b95f50975ecaa8dbfd37c375ebf38e1971fc960 (diff)
downloadcmd2-git-de12ee4782799350233be7adadeac08907c13e84.tar.gz
Added more to Settable docstring
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py
index 2bb91ccd..cfe75f53 100644
--- a/cmd2/utils.py
+++ b/cmd2/utils.py
@@ -103,9 +103,16 @@ class Settable:
:param choices: iterable of accepted values
:param choices_function: function that provides choices for this argument
- :param choices_method: cmd2-app method that provides choices for this argument
+ :param choices_method: cmd2-app method that provides choices for this argument (See note below)
:param completer_function: tab-completion function that provides choices for this argument
- :param completer_method: cmd2-app tab-completion method that provides choices for this argument
+ :param completer_method: cmd2-app tab-completion method that provides choices
+ for this argument (See note below)
+
+ Note:
+ For choices_method and completer_method, do not set them to a bound method. This is because AutoCompleter
+ passes the self argument explicitly to these functions.
+
+ Therefore instead of passing something like self.path_complete, pass cmd2.Cmd.path_complete.
"""
if val_type == bool:
val_type = str_to_bool