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

Method postcmd

examples/python_scripting.py:47–56  ·  view source on GitHub ↗

Hook method executed just after a command dispatch is finished. :param stop: if True, the command has indicated the application should exit :param line: the command line text for this command :return: if this is True, the application will exit after this command and the post

(self, stop: bool, _line: str)

Source from the content-addressed store, hash-verified

45 self.prompt = stylize(f"{self.cwd} $ ", style=Color.CYAN)
46
47 def postcmd(self, stop: bool, _line: str) -> bool:
48 """Hook method executed just after a command dispatch is finished.
49
50 :param stop: if True, the command has indicated the application should exit
51 :param line: the command line text for this command
52 :return: if this is True, the application will exit after this command and the postloop() will run
53 """
54 """Override this so prompt always displays cwd."""
55 self._set_prompt()
56 return stop
57
58 @cmd2.with_argument_list
59 def do_cd(self, arglist: list[str]) -> None:

Callers

nothing calls this directly

Calls 1

_set_promptMethod · 0.95

Tested by

no test coverage detected