mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-12-02 02:44:33 +00:00
fix child command issues
This commit is contained in:
1 parent
a5d101ff61
commit
0cd5898107
2 files changed
+3
-1
No files matched your search
@@ -50,8 +50,9 @@ public class TerraCommandManager implements CommandManager {
|
||||
|
||||
boolean req = true;
|
||||
for(Argument argument : command.arguments()) {
|
||||
if(!req && argument.required())
|
||||
if(!req && argument.required()) {
|
||||
throw new MalformedCommandException("Required arguments must come first! Arguments: " + Arrays.toString(command.arguments()));
|
||||
}
|
||||
req = argument.required();
|
||||
|
||||
if(args.isEmpty()) {
|
||||
|
||||
@@ -28,6 +28,7 @@ public class CommandTest {
|
||||
manager.execute("test", Arrays.asList("s2", "first", "2"));
|
||||
manager.execute("test", Arrays.asList("sub1", "first", "2", "3.4"));
|
||||
manager.execute("test", Arrays.asList("sub2", "first", "2"));
|
||||
manager.execute("test", Arrays.asList("first", "2")); // Parent command args
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user