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

Method register_postparsing_hook

cmd2/cmd2.py:5854–5857  ·  view source on GitHub ↗

Register a function to be called after parsing user input but before running the command.

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

Source from the content-addressed store, hash-verified

5852 raise TypeError(f"{func.__name__} must declare return a return type of 'cmd2.plugin.PostparsingData'")
5853
5854 def register_postparsing_hook(self, func: Callable[[plugin.PostparsingData], plugin.PostparsingData]) -> None:
5855 """Register a function to be called after parsing user input but before running the command."""
5856 self._validate_postparsing_callable(func)
5857 self._postparsing_hooks.append(func)
5858
5859 CommandDataType = TypeVar("CommandDataType")
5860

Calls 2

appendMethod · 0.80