示例#1
0
 /// <summary>
 /// Prints the usage
 /// </summary>
 private static void showUsage(string exe, string doc, ArgSpec[] Arguments)
 {
     Console.Out.WriteLine(string.Format("{0} <options> : {1}",exe,doc));
     Console.Out.WriteLine("Options:");
     foreach(ArgSpec argSpec in Arguments){
         Console.Out.Write(" -{0} {1}{2}{3} : {4}",
             argSpec.Name,
             argSpec.ValOptionnal?"[":"<",
             argSpec.ValName,
             argSpec.ValOptionnal?"]":">",
             argSpec.Doc
             );
     }
 }
示例#2
0
 /// <summary>
 /// Get the spec corresponding to the arg name
 /// </summary>
 /// <param name="argName">The argument name</param>
 /// <param name="Arguments">The argument list</param>
 /// <returns></returns>
 public static ArgSpec getArgSpec(String argName,ArgSpec[] Arguments)
 {
     foreach(ArgSpec spec in Arguments){
         if(spec.Name.Equals(argName))
             return spec;
     }
     return null;
 }