Changeset 2234 for trunk/eraser/Eraser/Program.cs
- Timestamp:
- 08/04/10 10:01:58 (22 months ago)
- File:
-
- 1 edited
-
trunk/eraser/Eraser/Program.cs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser/Program.cs
r2233 r2234 260 260 program.Handlers.Add("help", 261 261 new ConsoleActionData(CommandHelp, new ConsoleArguments())); 262 program.Handlers.Add("querymethods",263 new ConsoleActionData(CommandQueryMethods, new ConsoleArguments()));264 262 program.Handlers.Add("addtask", 265 263 new ConsoleActionData(CommandAddTask, new AddTaskArguments())); … … 304 302 } 305 303 304 //Get the list of registered Erasure Methods. First, output the header. 305 const string methodFormat = " {0,-2} {1,-35} {2}\n"; 306 StringBuilder methods = new StringBuilder(); 307 methods.AppendFormat(methodFormat, "", "Erasure Method", "GUID"); 308 methods.AppendLine(" " + new string('-', 75)); 309 310 //Generate the list of erasure methods. 311 foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 312 { 313 methods.AppendFormat(methodFormat, (method is UnusedSpaceErasureMethod) ? 314 "U" : "", method.Name, method.Guid); 315 } 316 306 317 //Print the message 307 318 Console.WriteLine(S._(@"usage: Eraser <action> <arguments> … … 309 320 help Show this help message. 310 321 addtask Adds a task to the current task list. 311 querymethods Lists all registered Erasure methods.312 322 importtasklist Imports an Eraser Task list to the current user's Task 313 323 List. … … 332 342 is next restarted. 333 343 334 where target is one of more of:344 where methodGUID and methodName any GUID/Name from the following list: 335 345 {0} 336 337 parameters for querymethods: 338 eraser querymethods 339 340 no parameters to set. 346 Only erasure methods labelled ""U"" can be used to erase unused disk space. 347 348 where target is one or more of: 349 {1} 341 350 342 351 parameters for importtasklist: … … 351 360 ""@"" to the path to the file, and passing it into the command line. The 352 361 contents of the response files' will be substituted at the same position into 353 the command line.", targets));362 the command line.", methods, targets)); 354 363 355 364 Console.Out.Flush(); … … 368 377 369 378 PrintCommandHelp(); 370 }371 372 /// <summary>373 /// Lists all registered erasure methods.374 /// </summary>375 /// <param name="arguments">Not used.</param>376 private static void CommandQueryMethods(ConsoleArguments arguments)377 {378 //Output the header379 const string methodFormat = "{0,-2} {1,-39} {2}";380 Console.WriteLine(methodFormat, "", "Erasure Method", "GUID");381 Console.WriteLine(new string('-', 79));382 383 //Refresh the list of erasure methods384 foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar)385 {386 Console.WriteLine(methodFormat, (method is UnusedSpaceErasureMethod) ?387 "U" : "", method.Name, method.Guid.ToString());388 }389 379 } 390 380
Note: See TracChangeset
for help on using the changeset viewer.
