summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-20 19:08:40 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-20 19:08:40 -0400
commitb902a49d174578e0f17336eeb2e0598b8167c4ee (patch)
treef1efcf6f67fe4d5e53cc670a7b7cb25209e6b614 /cmd2
parent108d3e5da6ac0bdf46579783f87d5a4b1f348b1c (diff)
downloadcmd2-git-b902a49d174578e0f17336eeb2e0598b8167c4ee.tar.gz
Added comments
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/cmd2.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index e8ad7d9d..bf4da2d3 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -117,12 +117,12 @@ CMD_ATTR_HELP_CATEGORY = 'help_category'
CMD_ATTR_ARGPARSER = 'argparser'
-def categorize(func: Union[Callable, Iterable], category: str) -> None:
+def categorize(func: Union[Callable, Iterable[Callable]], category: str) -> None:
"""Categorize a function.
The help command output will group this function under the specified category heading
- :param func: function to categorize
+ :param func: function or list of functions to categorize
:param category: category to put it in
"""
if isinstance(func, Iterable):
@@ -565,6 +565,8 @@ class Cmd(cmd.Cmd):
# values are DisabledCommand objects.
self.disabled_commands = dict()
+ # If any command has been categorized, then all other commands that haven't been categorized
+ # will display under this section in the help output.
self.default_category = 'Uncategorized'
# ----- Methods related to presenting output to the user -----