Skip to content

Commit b74b272

Browse files
committed
Clarify docstring for cmd_func
1 parent 33049bf commit b74b272

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd2/cmd2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,14 @@ def _restore_output(self, statement: Statement, saved_state: utils.RedirectionSa
20142014
def cmd_func(self, command: str) -> Optional[Callable]:
20152015
"""
20162016
Get the function for a command
2017+
20172018
:param command: the name of the command
2019+
2020+
:Example:
2021+
2022+
>>> helpfunc = self.cmd_func('help')
2023+
2024+
helpfunc now contains a reference to the ``do_help`` method
20182025
"""
20192026
func_name = self._cmd_func_name(command)
20202027
if func_name:

0 commit comments

Comments
 (0)