MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / do_custom_completer

Method do_custom_completer

examples/read_input.py:74–81  ·  view source on GitHub ↗

Call read_input to use custom history and completer function.

(self, _)

Source from the content-addressed store, hash-verified

72
73 @cmd2.with_category(EXAMPLE_COMMANDS)
74 def do_custom_completer(self, _) -> None:
75 """Call read_input to use custom history and completer function."""
76 self.poutput("Tab completing paths and using custom history")
77 try:
78 input_str = self.read_input("> ", history=self.custom_history, completer=cmd2.Cmd.path_complete)
79 self.custom_history.append(input_str)
80 except EOFError:
81 pass
82
83 @cmd2.with_category(EXAMPLE_COMMANDS)
84 def do_custom_parser(self, _) -> None:

Callers

nothing calls this directly

Calls 3

poutputMethod · 0.80
read_inputMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected