cmd2.command_definition¶
Supports the definition of commands in separate classes to be composed into cmd2.Cmd
-
class
cmd2.command_definition.
CommandSet
¶ Base class for defining sets of commands to load in cmd2.
with_default_category
can be used to apply a default category to all commands in the CommandSet.do_
,help_
, andcomplete_
functions differ only in that self is the CommandSet instead of the cmd2 app
-
cmd2.command_definition.
with_default_category
(category: str)¶ Decorator that applies a category to all
do_*
command methods in a class that do not already have a category specified.Parameters: category – category to put all uncategorized commands in Returns: decorator function