Skip to content

Commit

Permalink
command line is now working
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Oct 25, 2015
1 parent 6f44c11 commit 6433511
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/main/java/com/neuronrobotics/bowlerstudio/BowlerKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import java.util.LinkedList;
import java.util.List;

import jline.ConsoleReader;
import jline.Terminal;


import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine;
import com.neuronrobotics.bowlerstudio.scripting.ShellType;
import com.neuronrobotics.imageprovider.OpenCVJNILoader;
Expand Down Expand Up @@ -108,6 +108,12 @@ public static void main(String[] args) throws Exception {
reader.addTriggeredAction(Terminal.CTRL_C, e -> {
System.exit(0);
});


reader.getHistory().addToHistory("dyio.setValue(0,128)");
reader.getHistory().addToHistory("println dyio.getValue(0)");
reader.getHistory().addToHistory("println \"Hello world!\"");

reader.setBellEnabled(false);
reader.setDebug(new PrintWriter(new FileWriter("writer.debug", true)));

Expand All @@ -126,8 +132,22 @@ public void run() {
|| line.equalsIgnoreCase("exit")) {
break;
}
System.out.println("Result= "+ScriptingEngine.inlineScriptRun(line, null,
st));
if (line.equalsIgnoreCase("history")
|| line.equalsIgnoreCase("h")) {
List<String> h = reader.getHistory().getHistoryList();
for(String s:h){
System.out.println(s);
}
continue;
}
try {
System.out.println("Result= "+ScriptingEngine.inlineScriptRun(line, null,
st));
}catch (Error e) {
e.printStackTrace();
}catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit 6433511

Please sign in to comment.