**** Merged from MCS ****
[mono-project.git] / mcs / tools / corcompare / CorCompare.cs
blobbb956979fe303154b65932bc15d4bbd19cb1007e
1 // Mono.Util.CorCompare.CorCompareDriver
2 //
3 // Author(s):
4 // Nick Drochak (ndrochak@gol.com)
5 //
6 // (C) 2001-2002 Nick Drochak
8 using System;
9 using System.IO;
11 namespace Mono.Util.CorCompare {
13 /// <summary>
14 /// Handles command line arguments, and generates appropriate report(s)
15 /// based on those arguments
16 /// </summary>
17 /// <remarks>
18 /// created by - Nick
19 /// created on - 2/20/2002 10:43:57 PM
20 /// </remarks>
21 class CorCompareDriver
23 public static void Main(string[] args) {
24 // make sure we were called with the proper usage
25 if (args.Length < 1) {
26 Console.WriteLine("Usage: CorCompare [-t][-n][-x outfile][-ms assembly][-f friendly_name] assembly_to_compare");
27 return;
30 bool fList = false;
31 string strXML = null;
32 string strMono = args [args.Length - 1];
33 string strMS = null;
34 string strFriendly = null;
36 for (int i = 0; i < args.Length-1; i++) {
37 if (args [i] == "-t") {
38 fList = true;
40 if (args [i] == "-n") {
42 if (args [i] == "-x") {
43 strXML = args [++i];
45 if (args [i] == "-ms") {
46 strMS = args [++i];
48 if (args [i] == "-f") {
49 strFriendly = args [++i];
53 if (strMS == null)
54 strMS = Path.GetFileNameWithoutExtension (strMono);
56 if (strFriendly == null)
57 strFriendly = strMS;
59 if (strXML == null)
60 strXML = strFriendly + ".xml";
62 ToDoAssembly td = ToDoAssembly.Load (strMono, strFriendly, strMS);
64 if (fList)
65 Console.WriteLine(td.CreateClassListReport());
67 if (strXML != null)
68 td.CreateXMLReport(strXML);