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

Method register_postcmd_hook

cmd2/cmd2.py:5887–5890  ·  view source on GitHub ↗

Register a hook to be called after the command function.

(self, func: Callable[[plugin.PostcommandData], plugin.PostcommandData])

Source from the content-addressed store, hash-verified

5885 self._precmd_hooks.append(func)
5886
5887 def register_postcmd_hook(self, func: Callable[[plugin.PostcommandData], plugin.PostcommandData]) -> None:
5888 """Register a hook to be called after the command function."""
5889 self._validate_prepostcmd_hook(func, plugin.PostcommandData)
5890 self._postcmd_hooks.append(func)
5891
5892 @classmethod
5893 def _validate_cmdfinalization_callable(

Calls 2

appendMethod · 0.80