Skip to content

Change the way the top-level help() message is generated#32

Open
tiennou wants to merge 1 commit into
screeps:masterfrom
tiennou:feature/top-level-cli-help
Open

Change the way the top-level help() message is generated#32
tiennou wants to merge 1 commit into
screeps:masterfrom
tiennou:feature/top-level-cli-help

Conversation

@tiennou
Copy link
Copy Markdown

@tiennou tiennou commented Feb 25, 2026

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.

Example output with some of the mods updated to take advantage of this feature:

> help()
The supported commands are:
* help() - Print this help text.
* print(value) - Print a value to the console.
* storage - A global database storage object.
* map - Map editing functions.
* bots - Manage NPC bot players and their AI scripts.
* strongholds - Manage NPC Strongholds.
* system - System utility functions.
* utils - Extended screepsmod-admin-utils commands
* setPassword(username, password) - Reset a user's password
* mongo - MongoDB management commands
Type help(object) to learn more about specific usage of the object.
> 

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.
@tiennou tiennou force-pushed the feature/top-level-cli-help branch from 77763d5 to 103972c Compare April 8, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant