Open
Description
There should be an argument node that allows infinite repeat, for example, something along the lines of:
cd.register(
literal("addAll")
.then(
list("names", string())
.executes(c -> list.addAll(getStringList(c, "names")))
)
.then(
literal("from")
.then(
argument("name", string())
.executes(c -> list.addAddFrom(getString(c, "name")))
)
)
);
would allow stuff like:
/addAll foo bar baz
/addAll from qux
(while stuff like /addAll from
and /addAll from foo bar
would be disallowed. however, in this case, due to the (deliberate) use of string()
, the workaround is pretty obvious: /addAll "from"
or /addAll "from" foo bar
.)
Further, something like:
cd.register(
literal("enable_recursive")
.then(
list("names", string())
.executes(c -> ...)
.then(
literal("except")
.then(
list("excluded", string())
.executes(c -> ...)
)
)
)
);
would allow stuff like:
/enable_recursive foo bar
/enable_recursive foo bar except qux
/enable_recursive foo bar "except"
etc.
Metadata
Metadata
Assignees
Labels
No labels