improved cli args

master
Ondřej Hruška 11 years ago
parent 162bcc9b7e
commit 1b9c8c6be7
  1. 2
      Makefile
  2. 10
      src/mightypork/rogue/Launcher.java

@ -39,7 +39,7 @@ run: $(OUT)
java -jar $(OUT) -w .rogue-save java -jar $(OUT) -w .rogue-save
debug: $(OUT) debug: $(OUT)
java -jar $(OUT) -w .rogue-save --debug java -jar $(OUT) -w .rogue-save --verbose --debug-bus
stats: stats:
@-echo "Commits:" `git rev-list HEAD --count` @-echo "Commits:" `git rev-list HEAD --count`

@ -23,6 +23,7 @@ public class Launcher {
final Level llFile = Level.ALL; final Level llFile = Level.ALL;
File workdir = null; File workdir = null;
boolean logBus = false;
try { try {
boolean localWorkdir = false; boolean localWorkdir = false;
@ -41,11 +42,11 @@ public class Launcher {
llSyso = Level.OFF; llSyso = Level.OFF;
continue; continue;
} else if (arg.equals("--warnings") || arg.equals("-e")) { } else if (arg.equals("--warn") || arg.equals("-e")) {
llSyso = Level.WARNING; llSyso = Level.WARNING;
continue; continue;
} else if (arg.equals("--debug") || arg.equals("--verbose") || arg.equals("-v")) { } else if (arg.equals("--verbose") || arg.equals("-v")) {
llSyso = Level.ALL; llSyso = Level.ALL;
continue; continue;
@ -53,6 +54,9 @@ public class Launcher {
printHelp(); printHelp();
System.exit(0); System.exit(0);
} else if (arg.equals("--debug-bus")) {
logBus = true;
} else { } else {
System.err.println("Unknown argument: " + arg); System.err.println("Unknown argument: " + arg);
printHelp(); printHelp();
@ -76,7 +80,7 @@ public class Launcher {
final BaseApp app = new RogueApp(workdir, true); final BaseApp app = new RogueApp(workdir, true);
app.opt().setLogLevel(llFile, llSyso); app.opt().setLogLevel(llFile, llSyso);
app.opt().setBusLogging(false);//TODO temporary app.opt().setBusLogging(logBus);
app.start(); app.start();
} }

Loading…
Cancel
Save