Changeset 616 for branches/eraser6/Eraser/Program.cs
- Timestamp:
- 11/28/2008 12:27:28 PM (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Eraser/Program.cs (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/Program.cs
r612 r616 71 71 private static void CommandMain(string[] commandLine) 72 72 { 73 //Create a console for our GUI app.74 KernelAPI.AllocConsole();75 Console.SetOut(new StreamWriter(Console.OpenStandardOutput()));76 Console.SetIn(new StreamReader(Console.OpenStandardInput()));77 78 73 //Map commands to our functions. 79 74 Dictionary<string, CommandHandler> handlers = … … 91 86 if (commandLine.Length < 1) 92 87 { 88 CommandCreateConsole(); 93 89 CommandHelp(); 94 90 return; 95 91 } 96 92 else if (!handlers.ContainsKey(commandLine[0])) 97 throw new ArgumentException("Unknown action: " + commandLine[0]); 93 throw new ArgumentException("Unknown action: " + commandLine[0]); 98 94 99 95 //Parse the command line. … … 127 123 } 128 124 125 //If the user did not specify the quiet command line, then create the console. 126 if (!cmdParams.ContainsKey("q") && !cmdParams.ContainsKey("quiet")) 127 CommandCreateConsole(); 128 129 129 //Call the function 130 handlers[commandLine[0]](cmdParams); 130 using (ManagerLibrary library = new ManagerLibrary(new Settings())) 131 using (eraserClient = new RemoteExecutorClient()) 132 handlers[commandLine[0]](cmdParams); 131 133 } 132 134 catch (ArgumentException e) 133 135 { 136 CommandCreateConsole(); 134 137 Console.WriteLine(e.Message + "\n"); 135 138 CommandUsage(); 139 } 140 catch (Exception e) 141 { 142 Console.WriteLine(e.Message); 136 143 } 137 144 finally … … 147 154 KernelAPI.FreeConsole(); 148 155 } 156 } 157 158 /// <summary> 159 /// Creates a console for our application, setting the input/output streams to the 160 /// defaults. 161 /// </summary> 162 private static void CommandCreateConsole() 163 { 164 KernelAPI.AllocConsole(); 165 Console.SetOut(new StreamWriter(Console.OpenStandardOutput())); 166 Console.SetIn(new StreamReader(Console.OpenStandardInput())); 149 167 } 150 168 … … 191 209 addtask Adds tasks to the current task list. 192 210 querymethods Lists all registered Erasure methods. 211 212 global parameters: 213 --quiet, -q Do not create a Console window to display progress. 193 214 194 215 parameters for addtask:
Note: See TracChangeset
for help on using the changeset viewer.
