2005-10-10 John Luke <john.luke@gmail.com>
authorJohn Luke <jluke@mono-cvs.ximian.com>
Tue, 11 Oct 2005 01:43:42 +0000 (01:43 -0000)
committerJohn Luke <jluke@mono-cvs.ximian.com>
Tue, 11 Oct 2005 01:43:42 +0000 (01:43 -0000)
        * monop.cs: add PrintRefs and use it if the
        option is set
        * options.cs: add PrintRefs option to see the
        assemblies referenced by an assembly

svn path=/trunk/mcs/; revision=51541

mcs/tools/monop/ChangeLog
mcs/tools/monop/monop.cs
mcs/tools/monop/options.cs

index 058ab34375dc219313b3dc094d7707a397ffd759..c8b823fb74d0a1661c4178be26872b6be1715749 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-10  John Luke  <john.luke@gmail.com>
+
+       * monop.cs: add PrintRefs and use it if the
+       option is set
+       * options.cs: add PrintRefs option to see the
+       assemblies referenced by an assembly
+
 2005-10-10  John Luke  <john.luke@gmail.com>
 
        * monop.cs: don't print obsolete types if the
index 79f1f810033acf860438e691b5dc5c5eba7dd94f..df046cd903e714f42bdd7ddaa9c785433b9a8ae0 100644 (file)
@@ -198,6 +198,13 @@ class MonoP {
                return GetType (tname, false);
        }
 
+       static void PrintRefs (string assembly)
+       {
+               Assembly a = GetAssembly (assembly, true);
+               foreach (AssemblyName an in a.GetReferencedAssemblies ())
+                       Console.WriteLine (an);
+       }
+
        static void PrintTypes (string assembly, bool show_private, bool filter_obsolete)
        {
                Assembly a = GetAssembly (assembly, true);
@@ -279,7 +286,10 @@ class MonoP {
                        assembly = options.AssemblyReference;
                        
                        if (options.Type == null) {
-                               PrintTypes (assembly, options.ShowPrivate, options.FilterObsolete);
+                               if (options.PrintRefs)
+                                       PrintRefs (assembly);
+                               else
+                                       PrintTypes (assembly, options.ShowPrivate, options.FilterObsolete);
                                return;
                        }
                }
index aa20819c75339029f9bcbaa396230575602226aa..847cced0fd3812e4657f6cf487954e2c02e4f64a 100644 (file)
@@ -30,6 +30,7 @@ public class Options
 {
        public bool DeclaredOnly = false;
        public bool FilterObsolete = false;
+       public bool PrintRefs = false;
        public bool Search = false;
        public bool ShowPrivate = false;
        public string AssemblyReference = null;
@@ -69,6 +70,9 @@ public class Options
                                case "--private":
                                        ShowPrivate = true;
                                        break;
+                               case "--refs":
+                                       PrintRefs = true;
+                                       break;
                                case "-s":
                                case "-k":
                                case "--search":