|
|
|
|
@ -52,12 +52,13 @@ namespace ICSharpCode.Decompiler.Console
@@ -52,12 +52,13 @@ namespace ICSharpCode.Decompiler.Console
|
|
|
|
|
app.Error.WriteLine($"ERROR: Output directory '{outputOption.Value()}' does not exist."); |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
TextWriter output = System.Console.Out; |
|
|
|
|
try { |
|
|
|
|
if (projectOption.HasValue()) { |
|
|
|
|
DecompileAsProject(inputAssemblyFileName.Value, outputOption.Value()); |
|
|
|
|
} else if (listOption.HasValue()) { |
|
|
|
|
var values = listOption.Values.SelectMany(v => v.Split(',', ';')).ToArray(); |
|
|
|
|
HashSet<TypeKind> kinds = TypesParser.ParseSelection(values); |
|
|
|
|
TextWriter output = System.Console.Out; |
|
|
|
|
if (outputOption.HasValue()) { |
|
|
|
|
string directory = outputOption.Value(); |
|
|
|
|
string outputName = Path.GetFileNameWithoutExtension(inputAssemblyFileName.Value); |
|
|
|
|
@ -65,7 +66,6 @@ namespace ICSharpCode.Decompiler.Console
@@ -65,7 +66,6 @@ namespace ICSharpCode.Decompiler.Console
|
|
|
|
|
} |
|
|
|
|
ListContent(inputAssemblyFileName.Value, output, kinds); |
|
|
|
|
} else if (ilViewerOption.HasValue()) { |
|
|
|
|
TextWriter output = System.Console.Out; |
|
|
|
|
if (outputOption.HasValue()) { |
|
|
|
|
string directory = outputOption.Value(); |
|
|
|
|
string outputName = Path.GetFileNameWithoutExtension(inputAssemblyFileName.Value); |
|
|
|
|
@ -73,7 +73,6 @@ namespace ICSharpCode.Decompiler.Console
@@ -73,7 +73,6 @@ namespace ICSharpCode.Decompiler.Console
|
|
|
|
|
} |
|
|
|
|
ShowIL(inputAssemblyFileName.Value, output); |
|
|
|
|
} else { |
|
|
|
|
TextWriter output = System.Console.Out; |
|
|
|
|
if (outputOption.HasValue()) { |
|
|
|
|
string directory = outputOption.Value(); |
|
|
|
|
string outputName = Path.GetFileNameWithoutExtension(inputAssemblyFileName.Value); |
|
|
|
|
@ -81,6 +80,10 @@ namespace ICSharpCode.Decompiler.Console
@@ -81,6 +80,10 @@ namespace ICSharpCode.Decompiler.Console
|
|
|
|
|
} |
|
|
|
|
Decompile(inputAssemblyFileName.Value, output, typeOption.Value()); |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|
output.Close(); |
|
|
|
|
} |
|
|
|
|
// do not use Console here!
|
|
|
|
|
return 0; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -115,7 +118,6 @@ namespace ICSharpCode.Decompiler.Console
@@ -115,7 +118,6 @@ namespace ICSharpCode.Decompiler.Console
|
|
|
|
|
|
|
|
|
|
output.WriteLine($"// IL code: {decompiler.TypeSystem.MainModule.AssemblyName}"); |
|
|
|
|
output.WriteLine(textOutput.ToString()); |
|
|
|
|
output.Flush(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void DecompileAsProject(string assemblyFileName, string outputDirectory) |
|
|
|
|
|