summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-14 19:29:44 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2019-03-14 19:29:44 -0400
commiteb050d7ad09a4c17f4f2ef3d59735cf87272aded (patch)
tree072443e9c49720cd343ebde68f4cdf762c3d964f /examples
parentd2ebee4a6e55798f9d5fa41f8e2a200005b87cde (diff)
parent177297ae557383215f3dae698ff43e1cf9daecca (diff)
downloadcmd2-git-eb050d7ad09a4c17f4f2ef3d59735cf87272aded.tar.gz
Merge branch 'master' into attributes
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/help_categories.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/help_categories.py b/examples/help_categories.py
index e58bac02..62351e81 100755
--- a/examples/help_categories.py
+++ b/examples/help_categories.py
@@ -7,6 +7,7 @@ A sample application for tagging categories on commands.
import argparse
import cmd2
+from cmd2.cmd2 import COMMAND_NAME
class HelpCategories(cmd2.Cmd):
@@ -143,7 +144,9 @@ class HelpCategories(cmd2.Cmd):
@cmd2.with_category("Command Management")
def do_disable_commands(self, _):
"""Disable the Application Management commands"""
- self.disable_category(self.CMD_CAT_APP_MGMT, "Application Management is currently disabled")
+ message_to_print = "{} is not available while {} commands are disabled".format(COMMAND_NAME,
+ self.CMD_CAT_APP_MGMT)
+ self.disable_category(self.CMD_CAT_APP_MGMT, message_to_print)
self.poutput("The Application Management commands have been disabled")
@cmd2.with_category("Command Management")