diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-10 01:39:36 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-10 01:39:36 -0500 |
commit | 647f0727cf8e1c345d7b1e778e1132479f2168fb (patch) | |
tree | 95ac8df13aac7d32bbeb25bf3c9b5480e268ee4c /examples | |
parent | 102b6c121ccaa645fff02be0928a7342746232b8 (diff) | |
download | cmd2-git-647f0727cf8e1c345d7b1e778e1132479f2168fb.tar.gz |
Updated examples and documentation pertaining to disabling commands
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/help_categories.py | 12 |
1 files changed, 12 insertions, 0 deletions
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() |