Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve usage in command help #363

Closed
willkroboth opened this issue Nov 13, 2022 · 1 comment
Closed

Improve usage in command help #363

willkroboth opened this issue Nov 13, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request implemented for next release This has been implemented in the current dev build for the next public release
Milestone

Comments

@willkroboth
Copy link
Collaborator

Description

Currently, when you build a large branching command (pretty easy with a CommandTree) the usage given by /help can end up looking like this:

--------- Help: /configcommands -----------------
A command for interacting with the ConfigCommands system
Description: Different systems are accessed using their keywords. 
For help with a specific section, use /configcommands help <section>
Usage: 
- /configcommands 
- /configcommands <help> 
- /configcommands <help> <functions> 
- /configcommands <help> <build> 
- /configcommands <help> <reload> 
- /configcommands <help> <debug> 
- /configcommands <functions> 
- /configcommands <functions> <addOn> <internalArgument> <static> <function> 
- /configcommands <functions> <addOn> <internalArgument> <nonStatic> <function> 
- /configcommands <build> 
- /configcommands <reload> <greet> 
- /configcommands <reload> <greet> <message> 
- /configcommands <reload> <echo> <string> 
- /configcommands <debug> 
- /configcommands <debug> <enable> 
- /configcommands <debug> <disable> 
- /configcommands <debug> <local> <command> 
- /configcommands <debug> <local> <command> <enable> 
- /configcommands <debug> <local> <command> <disable>

In my example here, I would prefer the help look like this, highlighting and refining the most important command paths the user should care about:

--------- Help: /configcommands -----------------
A command for interacting with the ConfigCommands system
Description: Different systems are accessed using their keywords. 
For help with a specific section, use /configcommands help <section>
Usage: 
- /configcommands help
- /configcommands help <section>
- /configcommands <functions> 
- /configcommands <functions> <addOn> <internalArgument> <(non)static> <function> 
- /configcommands <build> 
- /configcommands <reload> <commandName> <arguments> 
- /configcommands <debug> 
- /configcommands <debug> <enable/disable> 
- /configcommands <debug> <local> <command> 
- /configcommands <debug> <local> <command> <enable/disable> 

Expected code

The default usage generation probably works fine for most users, but just like the default A Mojang provided command. message, it would be nice if it could be overridden. Perhaps something like this:

new CommandTree("configcommands")
        .withUsage(
            "configcommands help",
            "configcommands help <section>",
            "configcommands <functions>",
            "configcommands <functions> <addOn> <internalArgument> <(non)static> <function>",
            "configcommands <build>",
            "configcommands <reload> <commandName> <arguments>",
            "configcommands <debug>",
            "configcommands <debug> <enable/disable>",
            "configcommands <debug> <local> <command>",
            "configcommands <debug> <local> <command> <enable/disable>"
        )

Extra details

No response

@willkroboth willkroboth added the enhancement New feature or request label Nov 13, 2022
@JorelAli JorelAli added this to the 9.0.0 milestone Dec 10, 2022
@DerEchtePilz DerEchtePilz self-assigned this May 10, 2023
@DerEchtePilz DerEchtePilz added the implemented for next release This has been implemented in the current dev build for the next public release label May 23, 2023
@JorelAli
Copy link
Owner

JorelAli commented Jun 7, 2023

Implemented in 9.0.2

@JorelAli JorelAli closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request implemented for next release This has been implemented in the current dev build for the next public release
Projects
Archived in project
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants