summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-18 12:06:47 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-18 12:06:47 -0400
commitb5e08b06b4032d8656fa768814069b17ea613b62 (patch)
tree0f942f22d57d2686ed44dde2aec3583767d7d54f /cmd2/utils.py
parente8aa84b39872956cf881e845b8464a3807b58a6e (diff)
downloadcmd2-git-b5e08b06b4032d8656fa768814069b17ea613b62.tar.gz
Documented support for standalone functions being used as completers and choices_providers.
Added unit tests for this case.
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py
index d8d6b7cc..c5874d6e 100644
--- a/cmd2/utils.py
+++ b/cmd2/utils.py
@@ -104,12 +104,6 @@ class Settable:
:param choices: iterable of accepted values
:param choices_provider: function that provides choices for this argument
:param completer: tab completion function that provides choices for this argument
-
- Note:
- For choices_provider and completer, do not set them to a bound method. This is because
- ArgparseCompleter 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