static Console.Command push() {
return command(new String[] {"push"}, (console, args) -> {
- Object obj = console.handleInput(String.join(" ", args));
+ Object obj = console.internalHandleInput(String.join(" ", args));
if (obj instanceof Mode) { // obj could be anything, which should be fixed
console.out("pushing mode " + obj.getClass().getSimpleName());
console.getCakelight().pushMode((Mode) obj);
while (running) {
System.out.print("> ");
String input = reader.readLine();
- internalHandleInput(input);
+ handleInput(input);
}
} catch (IOException e) {
System.out.println("Error reading from command line");
}
}
- private void internalHandleInput(String input) {
- Object obj = handleInput(input);
+ void handleInput(String input) {
+ Object obj = internalHandleInput(input);
if (obj instanceof Mode) {
cakelight.setMode((Mode) obj);
}
}
- Object handleInput(String input) {
+ Object internalHandleInput(String input) {
String[] splitInput = input.split("\\s+", 2);
String name = splitInput[0];
String[] args = splitInput.length == 2