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

Method postcmd

cmd2/cmd2.py:2835–2844  ·  view source on GitHub ↗

Ran just after a command is executed by [cmd2.Cmd.onecmd][] (cmd inherited Hook method). :param stop: return `True` to request the command loop terminate :param statement: subclass of str which also contains the parsed input See [cmd2.Cmd.register_postcmd_hook][] and [cmd2.

(self, stop: bool, statement: Statement | str)

Source from the content-addressed store, hash-verified

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).
2837
2838 :param stop: return `True` to request the command loop terminate
2839 :param statement: subclass of str which also contains the parsed input
2840
2841 See [cmd2.Cmd.register_postcmd_hook][] and [cmd2.Cmd.register_cmdfinalization_hook][] for more robust ways
2842 to run hooks after the command is executed. See [Hooks](../features/hooks.md) for more information.
2843 """
2844 return stop
2845
2846 def preloop(self) -> None:
2847 """Ran once when the [cmd2.Cmd.cmdloop][] method is called (cmd inherited Hook method).

Callers 1

onecmd_plus_hooksMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected