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

Method do_basic_with_history

examples/read_input.py:29–37  ·  view source on GitHub ↗

Call read_input with custom history and no tab completion.

(self, _)

Source from the content-addressed store, hash-verified

27
28 @cmd2.with_category(EXAMPLE_COMMANDS)
29 def do_basic_with_history(self, _) -> None:
30 """Call read_input with custom history and no tab completion."""
31 self.poutput("Tab completion is off but using custom history")
32 try:
33 input_str = self.read_input("> ", history=self.custom_history)
34 except EOFError:
35 pass
36 else:
37 self.custom_history.append(input_str)
38
39 @cmd2.with_category(EXAMPLE_COMMANDS)
40 def do_custom_choices(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