Skip to content

Added ability to exclude some commands from help menu#114

Merged
tleonhardt merged 3 commits intomasterfrom
exclude_help
Jun 2, 2017
Merged

Added ability to exclude some commands from help menu#114
tleonhardt merged 3 commits intomasterfrom
exclude_help

Conversation

@tleonhardt
Copy link
Copy Markdown
Member

@tleonhardt tleonhardt commented Jun 2, 2017

Added the exclude_from_help member variable to the cmd2.Cmd class. This is a list of commands which should be excluded from the help menu. By default, only the do_eof command is included in this list.

Updated unit tests to reflect the new default help menu with "eof" missing.

The reason behind this feature is that it can be confusing to end users to show them commands which they should never ever have a good reason to directly enter on the command line. The eof "command" is one such obvious case.

I couldn't decide whether or not the _relative_load command should be included in that category or not. It should only ever be included in script files and not entered at the command line, so I guess it should be. But it is useful in scripts, so maybe it is good to know about via the help menu?

This closes #111

Made changes to suppress PyCharm Code Introspection warnings
Added a list of commands to explicitly exclude displaying in the help menu of commands which detailed help can be retrieved for.

By default, only "do_eof" is in this list since that isn't a command which is ever intended for an end user to directly enter on the command line.

Also updated unit tests to reflect new default help menu.
@tleonhardt tleonhardt added this to the 0.7.3 milestone Jun 2, 2017
@tleonhardt tleonhardt merged commit a0d829e into master Jun 2, 2017
@tleonhardt tleonhardt deleted the exclude_help branch June 2, 2017 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to exclude some commands from help menu

1 participant