Revision: 07ac2a71992f Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Mon Jul 30 18:41:52 2012 Log: multiple commands are now turned on by the option -multcom http://code.google.com/p/brailleblaster/source/detail?r=07ac2a71992f Modified: /src/main/org/brailleblaster/BBIni.java /src/main/org/brailleblaster/Main.java /src/main/org/brailleblaster/Subcommands.java ======================================= --- /src/main/org/brailleblaster/BBIni.java Wed Jul 18 15:52:42 2012 +++ /src/main/org/brailleblaster/BBIni.java Mon Jul 30 18:41:52 2012 @@ -61,7 +61,8 @@ private static boolean debug = false; private static boolean gotGui = true; private static boolean utd = false; - private static Logger logger; + private static boolean multipleSubcommands = false; + private static Logger logger; private static Display display = null; private static String BBVersion; private static String releaseDate; @@ -147,31 +148,34 @@ if (args[i].charAt(0) != '-') { break; } - if (args[i].equals ("-debug")) { - debug = true; - } - else if (args[i].equals ("-nogui")) { - gotGui = false; - } - else if (args[i].equals ("-utd")) { - utd = true; - } - else { - System.out.println ("Bad option " + args[i]); - } +if (args[i].equals ("-debug")) { +debug = true; +} +else if (args[i].equals ("-nogui")) { +gotGui = false; +} +else if (args[i].equals ("-utd")) { +utd = true; +} +else if (args[i].equals ("-multcom")) { +multipleSubcommands = true; +} +else { +System.out.println ("Bad option '" + args[i] + "'"); +} i++; - } +} if (i < args.length) { hSubcommands = true; } - } - if (gotGui) { - try { - display = new Display(); - } catch (SWTError e) { - logger.log (Level.SEVERE, "Can't find GUI", e); - } - } +} +if (gotGui) { +try { +display = new Display(); +} catch (SWTError e) { +logger.log (Level.SEVERE, "Can't find GUI", e); +} +} try { liblouisutdml.loadLibrary (nativeLibraryPath, nativeLibrarySuffix); liblouisutdml.initialize (programDataPath, tempFilesPath, @@ -290,6 +294,9 @@ public static boolean useUtd () { return utd; } +public static boolean multCommands () { +return multipleSubcommands; +} // FO public static void setUtd (boolean trueFalse) { utd = trueFalse; ======================================= --- /src/main/org/brailleblaster/Main.java Wed Jul 18 15:52:42 2012 +++ /src/main/org/brailleblaster/Main.java Mon Jul 30 18:41:52 2012 @@ -38,8 +38,8 @@ /** * This class contains the main method. If there are no arguments it * passes control directly to the word processor. If there are arguments-* it passes them to the constructor of the class Subcommands. It will do more
-* processing as the project develops. +* it passes them first to BBIni and then to Subcommands. +* It will do more processing as the project develops. */ public class Main { ======================================= --- /src/main/org/brailleblaster/Subcommands.java Sat Jul 28 21:06:42 2012 +++ /src/main/org/brailleblaster/Subcommands.java Mon Jul 30 18:41:52 2012 @@ -98,8 +98,10 @@ } new WPManager (subcommand); } +if (BBIni.multCommands()) { moreCommands(); } +} /** * Ask for more commands and execute them. @@ -111,7 +113,7 @@ return; } cons.printf ( -"Type a command at the prompt. Type exit when finished.\n"); +"Type another command at the prompt. Type exit when finished.\n"); while (true) { cons.printf ("Command: "); String line = cons.readLine();