Change the way the top-level help() message is generated#32
Open
tiennou wants to merge 1 commit into
Open
Conversation
This changes `generateCliHelp` to add a `_desc` property that can be used to set the name of the "category" the `help()` command will show for a given object. This allows mods, like screepsmod-admin-utils to properly show up in the `help()` command list instead of being earmouthed around. Said `_desc` property is either a string, in which case the key it applies to will automatically get `()` added and the string used as the description for it, or an array of two strings, the first one being the argument names and the second the description.
77763d5 to
103972c
Compare
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.
This changes
generateCliHelpto add a_descproperty that can be used to set the name of the "category" thehelp()command will show for a given object.This allows mods, like screepsmod-admin-utils to properly show up in the
help()command list instead of being earmouthed around.Said
_descproperty is either a string, in which case the key it applies to will automatically get()added and the string used as the description for it, or an array of two strings, the first one being the argument names and the second the description.Example output with some of the mods updated to take advantage of this feature: