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

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

Closed
globau opened this issue Apr 2, 2024 · 2 comments
Closed
Labels
bug Something isn't working implemented for next release This has been implemented in the current dev build for the next public release

Comments

@globau
Copy link

globau commented Apr 2, 2024

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

@globau globau added the bug Something isn't working label Apr 2, 2024
@DerEchtePilz
Copy link
Collaborator

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.

DerEchtePilz added a commit that referenced this issue Apr 3, 2024
For #536
Now displays the literal value instead of the node name
@DerEchtePilz DerEchtePilz added the implemented for next release This has been implemented in the current dev build for the next public release label Apr 3, 2024
@globau globau changed the title Help for MultiLiteralArgument shows the arg name instead of the literal tezt Help for MultiLiteralArgument shows the arg name instead of the literal text Apr 11, 2024
@JorelAli
Copy link
Owner

Fixed in version 9.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working implemented for next release This has been implemented in the current dev build for the next public release
Projects
None yet
Development

No branches or pull requests

3 participants