Ignore:
Timestamp:
8/4/2010 9:23:35 AM (22 months ago)
Author:
lowjoel
Message:

Make the generation of help text for addtask parameters done by the plugins, since the arguments are passed to them, they should document their own CLIs. To do this, the ICliConfigurer interface was modified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser/Program.cs

    r2227 r2232  
    4040using Eraser.Util; 
    4141using Eraser.DefaultPlugins; 
     42using System.Text; 
    4243 
    4344namespace Eraser 
     
    291292        private static void PrintCommandHelp() 
    292293        { 
     294            //Get the command-line help for every erasure target 
     295            StringBuilder targets = new StringBuilder(); 
     296            foreach (ErasureTarget target in ManagerLibrary.Instance.ErasureTargetRegistrar) 
     297            { 
     298                //Replace all \r\n with \n, and split into lines 
     299                string[] helpText = target.Configurer.Help().Replace("\r\n", "\n").Split('\r', '\n'); 
     300 
     301                //Pad the start of each line with spaces 
     302                foreach (string line in helpText) 
     303                    targets.AppendLine(line.Insert(0, "    ")); 
     304            } 
     305 
     306            //Print the message 
    293307            Console.WriteLine(S._(@"usage: Eraser <action> <arguments> 
    294308where action is 
     
    308322 
    309323parameters for addtask: 
    310   eraser addtask [/method=<methodGUID>] [/schedule=(now|manually|restart)] (recyclebin | unused=<volume> | dir=<directory> | file=<file>)[...] 
     324  eraser addtask [/method=<methodGUID>] [/schedule=(now|manually|restart)] <target> [target [...]] 
    311325 
    312326  /method             The Erasure method to use. 
     
    317331      restart         The task will be queued for execution when the computer 
    318332                      is next restarted. 
    319   recyclebin          Erases files and folders in the recycle bin 
    320   unused              Erases unused space in the volume. 
    321     optional arguments: unused=<drive>[,clusterTips[=(true|false)]] 
    322       clusterTips     If specified, the drive's files will have their 
    323                       cluster tips erased. This parameter accepts a Boolean 
    324                       value (true/false) as an argument; if none is specified 
    325                       true is assumed. 
    326   dir                 Erases files and folders in the directory 
    327     optional arguments: dir=<directory>[,-excludeMask][,+includeMask][,deleteIfEmpty] 
    328       excludeMask     A wildcard expression for files and folders to 
    329                       exclude. 
    330       includeMask     A wildcard expression for files and folders to 
    331                       include. 
    332                       The include mask is applied before the exclude mask. 
    333       deleteIfEmpty   Deletes the folder at the end of the erasure if it is 
    334                       empty. 
    335   file                Erases the specified file 
     333 
     334  where target is: 
     335{0} 
    336336 
    337337parameters for querymethods: 
     
    351351""@"" to the path to the file, and passing it into the command line. The 
    352352contents of the response files' will be substituted at the same position into 
    353 the command line.")); 
     353the command line.", targets)); 
     354 
    354355            Console.Out.Flush(); 
    355356        } 
Note: See TracChangeset for help on using the changeset viewer.