feat: Add help command and help definitions #192
Merged
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.
Closes #189.
Add support for the
/help
command, which dynamically builds a list of help commands based on thehelp()
procs defined for each command type, ieLogin
.The
help
proc returns a type ofHelpText
, which contains all the information necessary to render help information for that command. It contains the command, parameters (each parameters contains a name and description), aliases, and a description.The help text is generated (at compile time) by a macro called
buildCommandHelp()
. Once the/help
command is executed, the output ofbuildCommandHelp()
is passed to the task runner so that aHelpResult
event can be created and the help text can be displayed on screen. Because the text is generated at compile time, it is not necessary to pass this text through the task runner, and is displayed directly on screen in the main thread.NOTES
HelpResult
action which allows for the the command description to be written on the same line as the command name and keep the description spaced in line with all other descriptions, but it didn’t appear as readable as the format that I settled on in the end. I left it in there in case we wanted to change up how help is rendered.I didn't want to spend too much time on the "blank" part of theThe/, /send
command. I figured if there were strong objections to overall layout/rendering, then that may change anyway. But it's definitely possible to remove or change./, /send
has been replaced with/send
(visible in the first command shown in the screenshot above).