From 647f0727cf8e1c345d7b1e778e1132479f2168fb Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Sun, 10 Mar 2019 01:39:36 -0500 Subject: Updated examples and documentation pertaining to disabling commands --- examples/help_categories.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'examples/help_categories.py') diff --git a/examples/help_categories.py b/examples/help_categories.py index f638e0df..e58bac02 100755 --- a/examples/help_categories.py +++ b/examples/help_categories.py @@ -140,6 +140,18 @@ class HelpCategories(cmd2.Cmd): """Version command""" self.poutput(cmd2.__version__) + @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") + self.poutput("The Application Management commands have been disabled") + + @cmd2.with_category("Command Management") + def do_enable_commands(self, _): + """Enable the Application Management commands""" + self.enable_category(self.CMD_CAT_APP_MGMT) + self.poutput("The Application Management commands have been enabled") + if __name__ == '__main__': c = HelpCategories() -- cgit v1.2.1