This commit was manufactured by cvs2svn to create branch 'mono-1-0'.
[mono.git] / mcs / tools / corcompare / CorCompare.cs
1 // Mono.Util.CorCompare.CorCompareDriver
2 //
3 // Author(s):
4 //   Nick Drochak (ndrochak@gol.com)
5 //
6 // (C) 2001-2002 Nick Drochak
7
8 using System;
9 using System.IO;
10
11 namespace Mono.Util.CorCompare {
12
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
22         {
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;
28                         }
29
30                         bool fList = false;
31                         string strXML = null;
32                         string strMono = args [args.Length - 1];
33                         string strMS = null;
34                         string strFriendly = null;
35
36                         for (int i = 0; i < args.Length-1; i++) {
37                                 if (args [i] == "-t") {
38                                         fList = true;
39                                 }
40                                 if (args [i] == "-n") {
41                                 }
42                                 if (args [i] == "-x") {
43                                         strXML = args [++i];
44                                 }
45                                 if (args [i] == "-ms") {
46                                         strMS = args [++i];
47                                 }
48                                 if (args [i] == "-f") {
49                                         strFriendly = args [++i];
50                                 }
51                         }
52
53                         if (strMS == null)
54                                 strMS = Path.GetFileNameWithoutExtension (strMono);
55
56                         if (strFriendly == null)
57                                 strFriendly = strMS;
58
59                         if (strXML == null)
60                                 strXML = strFriendly + ".xml";
61
62                         ToDoAssembly td = ToDoAssembly.Load (strMono, strFriendly, strMS);
63
64                         if (fList)
65                                 Console.WriteLine(td.CreateClassListReport());
66
67                         if (strXML != null)
68                                 td.CreateXMLReport(strXML);
69
70                 }
71         }
72 }