JorelAli / CommandAPI

A Bukkit/Spigot API for the command UI introduced in Minecraft 1.13
https://commandapi.jorel.dev
MIT License
504 stars 60 forks source link

Help for MultiLiteralArgument shows the arg name instead of the literal text #536

Closed globau closed 2 months ago

globau commented 3 months ago

CommandAPI version

9.3.0

Minecraft version

1.20.4

Are you shading the CommandAPI?

Yes

What I did

    new CommandAPICommand("invite")
        .withShortDescription("Allow a player to join the server")
        .withArguments(new MultiLiteralArgument("type", "java", "bedrock"))
        .withArguments(new StringArgument("player"))
        .executes(
            (CommandSender sender, CommandArguments args) ->
                ...

What actually happened

> help invite
[22:28:16 INFO]: --------- Help: /invite -------------------------
[22:28:16 INFO]: Allow a player to join the server
[22:28:16 INFO]: Usage:
[22:28:16 INFO]: - /invite <type> <player>
[22:28:16 INFO]: - /invite <type> <player>

What should have happened

> help invite
[22:28:16 INFO]: --------- Help: /invite -------------------------
[22:28:16 INFO]: Allow a player to join the server
[22:28:16 INFO]: Usage:
[22:28:16 INFO]: - /invite java <player>
[22:28:16 INFO]: - /invite bedrock <player>

Ideally if the number of options is small (eg. <= 5) all options should be listed, otherwise just one line with the name:

> help invite
[22:28:16 INFO]: --------- Help: /invite -------------------------
[22:28:16 INFO]: Allow a player to join the server
[22:28:16 INFO]: Usage:
[22:28:16 INFO]: - /invite <type> <player>

Server logs and CommandAPI config

No response

Other

No response

DerEchtePilz commented 3 months ago

Thanks for your report!

Unfortunately, this isn't as straight forward as I initially thought because at the point where the usage is generated, we do have no knowledge about which argument is used at which point. I am interested in looking into this as for literal arguments the literal value should be displayed instead of the node name.

JorelAli commented 2 months ago

Fixed in version 9.4.0.