Ran just before the command is executed by [cmd2.Cmd.onecmd][] and after adding it to history (cmd Hook method). :param statement: subclass of str which also contains the parsed input :return: a potentially modified version of the input Statement object See [cmd2.Cmd.regist
(self, statement: Statement | str)
| 2822 | """ |
| 2823 | |
| 2824 | def precmd(self, statement: Statement | str) -> Statement: |
| 2825 | """Ran just before the command is executed by [cmd2.Cmd.onecmd][] and after adding it to history (cmd Hook method). |
| 2826 | |
| 2827 | :param statement: subclass of str which also contains the parsed input |
| 2828 | :return: a potentially modified version of the input Statement object |
| 2829 | |
| 2830 | See [cmd2.Cmd.register_postparsing_hook][] and [cmd2.Cmd.register_precmd_hook][] for more robust ways |
| 2831 | to run hooks before the command is executed. See [Hooks](../features/hooks.md) for more information. |
| 2832 | """ |
| 2833 | return Statement(statement) if not isinstance(statement, Statement) else statement |
| 2834 | |
| 2835 | def postcmd(self, stop: bool, statement: Statement | str) -> bool: # noqa: ARG002 |
| 2836 | """Ran just after a command is executed by [cmd2.Cmd.onecmd][] (cmd inherited Hook method). |
no test coverage detected