5 // Jb Evain (jbevain@novell.com)
7 // Copyright (C) 2008 Novell, Inc (http://www.novell.com)
11 using System
.Collections
.Generic
;
12 using System
.Reflection
;
16 namespace Mono
.CilStripper
{
20 static int Main (string [] arguments
)
22 var args
= new List
<string> (arguments
);
23 if (args
.Count
> 0 && args
[0] == "-q") {
32 string file
= args
[0];
33 string output
= args
.Count
> 1 ? args
[1] : file
;
36 AssemblyDefinition assembly
= AssemblyFactory
.GetAssembly (file
);
37 StripAssembly (assembly
, output
);
41 Console
.WriteLine ("Assembly {0} stripped out into {1}", file
, output
);
43 Console
.WriteLine ("Assembly {0} stripped", file
);
46 } catch (TargetInvocationException tie
) {
47 Console
.WriteLine ("Error: {0}", tie
.InnerException
);
48 } catch (Exception e
) {
49 Console
.WriteLine ("Error: {0}", e
);
54 static void StripAssembly (AssemblyDefinition assembly
, string output
)
56 AssemblyStripper
.StripAssembly (assembly
, output
);
63 Console
.WriteLine ("Mono CIL Stripper");
69 Console
.WriteLine ("Usage: mono-cil-strip [options] file [output]");
70 Console
.WriteLine (" -q Only output errors.");