+ String urlString = null;
+ String luid = null;
+ String typeString = null;
+ String chapString = null;
+ String target = null;
+ MainAction action = MainAction.START;
+ Boolean plusInfo = null;
+
+ boolean noMoreActions = false;
+
+ int exitCode = 0;
+ for (int i = 0; exitCode == 0 && i < args.length; i++) {
+ // Action (--) handling:
+ if (!noMoreActions && args[i].startsWith("--")) {
+ if (args[i].equals("--")) {
+ noMoreActions = true;
+ } else {
+ try {
+ action = MainAction.valueOf(args[i].substring(2)
+ .toUpperCase().replace("-", "_"));
+ } catch (Exception e) {
+ Instance.syserr(new IllegalArgumentException(
+ "Unknown action: " + args[i], e));
+ exitCode = 255;
+ }
+ }
+
+ continue;
+ }