Exemplo n.º 1
0
 static void ParseOption(AssemblyTranslator translator, string option)
 {
     var m = Regex.Match(option, "-(-?)(?'key'[a-zA-Z]*)([=:](?'value'.*))?", RegexOptions.ExplicitCapture);
     if (m.Success) {
         switch (m.Groups["key"].Value) {
             case "out":
             case "o":
                 translator.OutputDirectory = Path.GetFullPath(m.Groups["value"].Value);
                 break;
             case "nodeps":
             case "nd":
                 translator.IncludeDependencies = false;
                 break;
             case "ignore":
             case "i":
                 translator.IgnoredAssemblies.Add(new Regex(m.Groups["value"].Value, RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture));
                 break;
             case "stub":
             case "s":
                 translator.StubbedAssemblies.Add(new Regex(m.Groups["value"].Value, RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture));
                 break;
             case "proxy":
             case "p":
                 translator.AddProxyAssembly(Path.GetFullPath(m.Groups["value"].Value), false);
                 break;
         }
     }
 }