You've already forked linux-packaging-mono
Imported Upstream version 5.20.0.180
Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
parent
0e2d47d1c8
commit
0510252385
@@ -8,6 +8,7 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using Mono.Cecil;
|
||||
@@ -15,25 +16,32 @@ using Mono.Cecil;
|
||||
namespace Mono.CilStripper {
|
||||
|
||||
class Program {
|
||||
|
||||
static int Main (string [] args)
|
||||
static bool quiet;
|
||||
static int Main (string [] arguments)
|
||||
{
|
||||
var args = new List<string> (arguments);
|
||||
if (args.Count > 0 && args [0] == "-q") {
|
||||
quiet = true;
|
||||
args.RemoveAt (0);
|
||||
}
|
||||
Header ();
|
||||
|
||||
if (args.Length == 0)
|
||||
if (args.Count == 0)
|
||||
Usage ();
|
||||
|
||||
string file = args [0];
|
||||
string output = args.Length > 1 ? args [1] : file;
|
||||
string output = args.Count > 1 ? args [1] : file;
|
||||
|
||||
try {
|
||||
AssemblyDefinition assembly = AssemblyFactory.GetAssembly (file);
|
||||
StripAssembly (assembly, output);
|
||||
|
||||
if (file != output)
|
||||
Console.WriteLine ("Assembly {0} stripped out into {1}", file, output);
|
||||
else
|
||||
Console.WriteLine ("Assembly {0} stripped", file);
|
||||
if (!quiet) {
|
||||
if (file != output)
|
||||
Console.WriteLine ("Assembly {0} stripped out into {1}", file, output);
|
||||
else
|
||||
Console.WriteLine ("Assembly {0} stripped", file);
|
||||
}
|
||||
return 0;
|
||||
} catch (TargetInvocationException tie) {
|
||||
Console.WriteLine ("Error: {0}", tie.InnerException);
|
||||
@@ -50,13 +58,16 @@ namespace Mono.CilStripper {
|
||||
|
||||
static void Header ()
|
||||
{
|
||||
if (quiet)
|
||||
return;
|
||||
Console.WriteLine ("Mono CIL Stripper");
|
||||
Console.WriteLine ();
|
||||
}
|
||||
|
||||
static void Usage ()
|
||||
{
|
||||
Console.WriteLine ("Usage: mono-cil-strip file [output]");
|
||||
Console.WriteLine ("Usage: mono-cil-strip [options] file [output]");
|
||||
Console.WriteLine (" -q Only output errors.");
|
||||
Environment.Exit (1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user