diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-22 14:06:05 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-22 14:06:05 -0400 |
| commit | a73e6dfa825f046fb26eb055e08f65307e199979 (patch) | |
| tree | eea5804f41a90dcfec18c1708c935795b77a43db /examples/remove_unused.py | |
| parent | 9d724f274620942319c0fa5b6e9fd879ef39befb (diff) | |
| download | cmd2-git-a73e6dfa825f046fb26eb055e08f65307e199979.tar.gz | |
Renamed exclude_from_help to hidden_commands
Renamed excludeFromHistory to exclude_from_history
No longer tab completing hidden commands
Diffstat (limited to 'examples/remove_unused.py')
| -rwxr-xr-x | examples/remove_unused.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/remove_unused.py b/examples/remove_unused.py index 2de0e9b6..cf26fcff 100755 --- a/examples/remove_unused.py +++ b/examples/remove_unused.py @@ -2,8 +2,8 @@ # coding=utf-8 """A simple example demonstrating how to remove unused commands. -Commands can be removed from the help menu by appending their full command name (including "do_") to the -"exclude_from_help" list. These commands will still exist and can be executed and help can be retrieved for them by +Commands can be removed from help menu and tab completion by appending their command name to the hidden_commands list. +These commands will still exist and can be executed and help can be retrieved for them by name, they just won't clutter the help menu. Commands can also be removed entirely by using Python's "del". @@ -18,8 +18,8 @@ class RemoveUnusedBuiltinCommands(cmd2.Cmd): def __init__(self): cmd2.Cmd.__init__(self) - # To hide commands from displaying in the help menu, add their function name to the exclude_from_help list - self.exclude_from_help.append('do_py') + # To hide commands from displaying in the help menu, add them to the hidden_commands list + self.hidden_commands.append('py') # To remove built-in commands entirely, delete their "do_*" function from the cmd2.Cmd class del cmd2.Cmd.do_edit |
