summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/modular_commands/commandset_basic.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/modular_commands/commandset_basic.py b/examples/modular_commands/commandset_basic.py
index 8b51b7e4..01ce1b39 100644
--- a/examples/modular_commands/commandset_basic.py
+++ b/examples/modular_commands/commandset_basic.py
@@ -11,8 +11,21 @@ from cmd2.utils import CompletionError
@register_command
@with_category("AAA")
def do_unbound(cmd: Cmd, statement: Statement):
+ """This is an example of registering an unbound function
+
+ :param cmd:
+ :param statement:
+ :return:
+ """
+ cmd.poutput('Unbound Command: {}'.format(statement.args))
+
+
+@register_command
+@with_category("AAA")
+def do_func_with_help(cmd: Cmd, statement: Statement):
"""
This is an example of registering an unbound function
+
:param cmd:
:param statement:
:return:
@@ -20,6 +33,10 @@ def do_unbound(cmd: Cmd, statement: Statement):
cmd.poutput('Unbound Command: {}'.format(statement.args))
+def help_func_with_help(cmd: Cmd):
+ cmd.poutput('Help for func_with_help')
+
+
@with_default_category('Basic Completion')
class BasicCompletionCommandSet(CommandSet):
# List of strings used with completion functions