Call read_input to use custom history and choices provider function.
(self, _)
| 57 | |
| 58 | @cmd2.with_category(EXAMPLE_COMMANDS) |
| 59 | def do_custom_choices_provider(self, _) -> None: |
| 60 | """Call read_input to use custom history and choices provider function.""" |
| 61 | self.poutput("Tab completing with choices from provider function and using custom history") |
| 62 | try: |
| 63 | input_str = self.read_input( |
| 64 | "> ", |
| 65 | history=self.custom_history, |
| 66 | choices_provider=ReadInputApp.choices_provider, |
| 67 | ) |
| 68 | except EOFError: |
| 69 | pass |
| 70 | else: |
| 71 | self.custom_history.append(input_str) |
| 72 | |
| 73 | @cmd2.with_category(EXAMPLE_COMMANDS) |
| 74 | def do_custom_completer(self, _) -> None: |
nothing calls this directly
no test coverage detected