@@ -1341,7 +1341,8 @@ def ppaged(self, msg: Any, *, end: str = '\n', chop: bool = False) -> None:
1341
1341
# ----- Methods related to tab completion -----
1342
1342
1343
1343
def _reset_completion_defaults (self ) -> None :
1344
- """Resets tab completion settings
1344
+ """Reset tab completion settings.
1345
+
1345
1346
Needs to be called each time readline runs tab completion.
1346
1347
"""
1347
1348
self .allow_appended_space = True
@@ -2406,47 +2407,43 @@ def _raise_keyboard_interrupt(self) -> None:
2406
2407
raise KeyboardInterrupt ("Got a keyboard interrupt" )
2407
2408
2408
2409
def precmd (self , statement : Union [Statement , str ]) -> Statement :
2409
- """Hook method executed just before the command is executed by
2410
- [cmd2.Cmd.onecmd][] and after adding it to history.
2410
+ """Ran just before the command is executed by [cmd2.Cmd.onecmd][] and after adding it to history (cmd Hook method).
2411
2411
2412
2412
:param statement: subclass of str which also contains the parsed input
2413
2413
:return: a potentially modified version of the input Statement object
2414
2414
2415
- See [cmd2.Cmd.register_postparsing_hook][] and
2416
- [cmd2.Cmd.register_precmd_hook][] for more robust ways
2417
- to run hooks before the command is executed. See
2418
- [Hooks](../features/hooks.md) for more information.
2415
+ See [cmd2.Cmd.register_postparsing_hook][] and [cmd2.Cmd.register_precmd_hook][] for more robust ways
2416
+ to run hooks before the command is executed. See [Hooks](../features/hooks.md) for more information.
2419
2417
"""
2420
2418
return Statement (statement ) if not isinstance (statement , Statement ) else statement
2421
2419
2422
2420
def postcmd (self , stop : bool , statement : Union [Statement , str ]) -> bool : # noqa: ARG002
2423
- """Hook method executed just after a command is executed by
2424
- [cmd2.Cmd.onecmd][].
2421
+ """Ran just after a command is executed by [cmd2.Cmd.onecmd][] (cmd inherited Hook method).
2425
2422
2426
2423
:param stop: return `True` to request the command loop terminate
2427
2424
:param statement: subclass of str which also contains the parsed input
2428
2425
2429
2426
See [cmd2.Cmd.register_postcmd_hook][] and [cmd2.Cmd.register_cmdfinalization_hook][] for more robust ways
2430
- to run hooks after the command is executed. See
2431
- [Hooks](../features/hooks.md) for more information.
2427
+ to run hooks after the command is executed. See [Hooks](../features/hooks.md) for more information.
2432
2428
"""
2433
2429
return stop
2434
2430
2435
2431
def preloop (self ) -> None :
2436
- """Hook method executed once when the [cmd2.Cmd.cmdloop][]
2437
- method is called.
2432
+ """Ran once when the [cmd2.Cmd.cmdloop][] method is called (cmd inherited Hook method).
2433
+
2434
+ This method is a stub that does nothing and exists to be overridden by subclasses.
2438
2435
2439
- See [cmd2.Cmd.register_preloop_hook][] for a more robust way
2440
- to run hooks before the command loop begins. See
2441
- [Hooks](../features/hooks.md) for more information.
2436
+ See [cmd2.Cmd.register_preloop_hook][] for a more robust wayto run hooks before the command loop begins.
2437
+ See [Hooks](../features/hooks.md) for more information.
2442
2438
"""
2443
2439
2444
2440
def postloop (self ) -> None :
2445
- """Hook method executed once when the [cmd2.Cmd.cmdloop][] method is about to return.
2441
+ """Ran once when the [cmd2.Cmd.cmdloop][] method is about to return (cmd inherited Hook Method).
2442
+
2443
+ This method is a stub that does nothing and exists to be overridden by subclasses.
2446
2444
2447
- See [cmd2.Cmd.register_postloop_hook][] for a more robust way
2448
- to run hooks after the command loop completes. See
2449
- [Hooks](../features/hooks.md) for more information.
2445
+ See [cmd2.Cmd.register_postloop_hook][] for a more robust way to run hooks after the command loop completes.
2446
+ See [Hooks](../features/hooks.md) for more information.
2450
2447
"""
2451
2448
2452
2449
def parseline (self , line : str ) -> tuple [str , str , str ]:
0 commit comments