Closed Librazy closed 7 years ago
And what if I simply need a argument that contains a :
?
/rpitem description item add `Foo: bar`
`Foo: bar` should be parsed as a whole string "Foo: bar"
and Foo:`Foo bars` is a k-v pair
Then just call nextString()
as shown here.
Another demo:
String cmd = "`foo: bar` foo:foo:bar";
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
arg.nextString(); // Returns "foo: bar"
arg.argString("foo"); // Returns "foo:bar"
With key:`value` enabled, I can use syntax like
/rpgitem power item command cooldown:10 command:`say hi`
/heh search name:`Wood sword`
and I can make tab completion like
/rpgitem power item command
(tab)
/rpgitem power item command cooldown:`` mouse:`` command:``
instead of
/rpgitem power item command `cooldown:` ` mouse:` `command:`
which leads to lot of confusing.
You may want to quote whole
key:value
pair with`
see 88460ace70688eb4fd2c5befbc87ac2a2c9c772b