summaryrefslogtreecommitdiff
path: root/examples/modular_commands/commandset_complex.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-13 14:19:05 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-13 14:20:31 -0400
commite6da8596c433f46bc337c7e8a14c7de1b0310e4c (patch)
tree09f5a3225376e26dcb03419d6243c8fc52433b07 /examples/modular_commands/commandset_complex.py
parent5dd2d03ef35a3d33ff53d82c8039d68e263246ee (diff)
downloadcmd2-git-e6da8596c433f46bc337c7e8a14c7de1b0310e4c.tar.gz
Replaced choices_function / choices_method with choices_provider.
Replaced completer_function / completer_method with completer. ArgparseCompleter now always passes cmd2.Cmd or CommandSet instance as the self argument to choices_provider and completer functions. Moved basic_complete from utils into cmd2.Cmd class. Moved CompletionError to exceptions.py
Diffstat (limited to 'examples/modular_commands/commandset_complex.py')
-rw-r--r--examples/modular_commands/commandset_complex.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/modular_commands/commandset_complex.py b/examples/modular_commands/commandset_complex.py
index 7c6b1300..a4343ae3 100644
--- a/examples/modular_commands/commandset_complex.py
+++ b/examples/modular_commands/commandset_complex.py
@@ -8,7 +8,6 @@ import argparse
from typing import List
import cmd2
-from cmd2 import utils
@cmd2.with_default_category('Fruits')
@@ -42,7 +41,7 @@ class CommandSetA(cmd2.CommandSet):
self._cmd.poutput(', '.join(['{}']*len(args)).format(*args))
def complete_durian(self, text: str, line: str, begidx: int, endidx: int) -> List[str]:
- return utils.basic_complete(text, line, begidx, endidx, ['stinks', 'smells', 'disgusting'])
+ return self._cmd.basic_complete(text, line, begidx, endidx, ['stinks', 'smells', 'disgusting'])
elderberry_parser = cmd2.Cmd2ArgumentParser('elderberry')
elderberry_parser.add_argument('arg1')