Skip to content

Commit 8b3c565

Browse files
committed
fix 0131db8
1 parent 7f4090b commit 8b3c565

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/cat/nyaa/nyaacore/CommandReceiver.java

+4
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ private Arguments(CommandSender sender) {
370370
this.sender = sender;
371371
}
372372

373+
public static Arguments parse(String[] rawArg) {
374+
return parse(rawArg, null);
375+
}
376+
373377
public static Arguments parse(String[] rawArg, CommandSender sender) {
374378
if (rawArg.length == 0) return new Arguments(sender);
375379
String cmd = rawArg[0];

src/test/java/cat/nyaa/nyaacore/ArgumentsTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class ArgumentsTest {
88
@Test
99
public void test1() throws Exception {
1010
String cmd = "`foo bar` far `bar \\`foo`";
11-
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "), null);
11+
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
1212
assertNotNull(arg);
1313
assertEquals("foo bar", arg.nextString());
1414
assertEquals("far", arg.nextString());
@@ -34,7 +34,7 @@ public void test2() throws Exception {
3434
@Test
3535
public void test3() throws Exception {
3636
String cmd = "t w key:`3` key2:`/co l u:miu_bug` ke3y:`12`";
37-
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "), null);
37+
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
3838
assertNotNull(arg);
3939
assertEquals(3, arg.argInt("key"));
4040
assertEquals("/co l u:miu_bug", arg.argString("key2"));

0 commit comments

Comments
 (0)