Added ability to exclude some commands from help menu#114
Merged
tleonhardt merged 3 commits intomasterfrom Jun 2, 2017
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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