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

Some listable types should not enforce uniqueness #106

Open
FableRBX opened this issue Mar 7, 2020 · 4 comments
Open

Some listable types should not enforce uniqueness #106

FableRBX opened this issue Mar 7, 2020 · 4 comments

Comments

@FableRBX
Copy link
Contributor

FableRBX commented Mar 7, 2020

Array type arguments (ex: "strings" type) are not being parsed into arrays in sequential order.
For example, the following command definition has its third argument of type "strings"

return {
    Name = "dev",
    Description = "Runs an internal developer command.",
    Group = "Admin",
    Args = {
        {
            Type = "string",
            Name = "Command",
            Description = "The internal command to run.",
        },
        {
            Type = "player",
            Name = "target",
            Description = "The target player to run command for.",
        },
        {
            Type = "strings";
            Name = "dataArgs";
            Description = "List of data arguments.";
        },
    }

When entering a series of strings on the command line, they are provided in an argument table out of order.
cmdr_args_order

@FableRBX FableRBX changed the title Array arguments are improperly ordered. String array arguments are improperly ordered. Mar 7, 2020
@FableRBX
Copy link
Contributor Author

FableRBX commented Mar 7, 2020

Tested using "numbers" instead of "strings" and the order appears to be maintained for numbers but not strings 🤔

@evaera
Copy link
Owner

evaera commented Mar 7, 2020

This behavior is intended, because lists are more like sets in that they can only contain a value once at most. I can see why this would be undesirable at times, so it would be nice to have this uniqueness be optional.

The reason Cmdr does this is for in the case of commands that take players, it would probably be unexpected if the resultant array contained a player more than once. However for strings, the natural intuition is probably the opposite.

@FableRBX
Copy link
Contributor Author

FableRBX commented Mar 7, 2020

Ok, closing issue in that case!

@FableRBX FableRBX closed this as completed Mar 7, 2020
@evaera
Copy link
Owner

evaera commented Mar 7, 2020

I'd like to keep it open as this is still a problem that needs to be addressed. I think maybe the uniqueness should only be enforced for certain types.

@evaera evaera reopened this Mar 7, 2020
@autonordev autonordev changed the title String array arguments are improperly ordered. Some listable types should not enforce uniqueness Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants