2004-12-24 John Luke <john.luke@gmail.com>
authorJohn Luke <jluke@mono-cvs.ximian.com>
Sun, 26 Dec 2004 21:21:50 +0000 (21:21 -0000)
committerJohn Luke <jluke@mono-cvs.ximian.com>
Sun, 26 Dec 2004 21:21:50 +0000 (21:21 -0000)
        * monop.cs: sort the types when printing an assembly
        handle -r:~/foo.dll by substituting for $HOME
        * TypeSorter.cs: IComparer to sort types by name

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

mcs/tools/monop/ChangeLog
mcs/tools/monop/TODO
mcs/tools/monop/monop.cs
mcs/tools/monop/monop.exe.sources

index 7944f158a4853fbaa6ba3cb52e1d1abfe9776615..26030ca4e4e029b384ee67714936fcb432139872 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-24  John Luke  <john.luke@gmail.com>
+
+       * monop.cs: sort the types when printing an assembly
+       handle -r:~/foo.dll by substituting for $HOME
+       * TypeSorter.cs: IComparer to sort types by name
+
 2004-12-25  Ben Maurer  <bmaurer@ximian.com>
 
        * monop.cs, outline.cs, monop-completion.sh: Add MIT/X11 License.
index 60ad9458f9bf0af4673f3d0942978a45b3a3625f..1ec49c5e51c48970c3a0f37daa279676beb3cc31 100644 (file)
@@ -2,5 +2,5 @@ TODO
 ----
 
        * handle explicit vs. implicit interfaces
-       * handle ~ based paths (ex -r:~/foo.dll)
        * improve commandline handling
+               (arguments should be order independent)
index 2a92c1a6c5c2b56a084d039ef6384cb62d64d920..4e4a51a019844d9dcce52111f718dd64e60824f1 100644 (file)
@@ -108,6 +108,10 @@ class MonoP {
        {
                Assembly a = null;
 
+               // if -r:~/foo.dll syntax is used the shell misses it
+               if (assembly.StartsWith ("~/"))
+                       assembly = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), assembly.Substring (2));
+
                try {
                        // if it exists try to use LoadFrom
                        if (File.Exists (assembly))
@@ -174,6 +178,7 @@ class MonoP {
                        
                Console.WriteLine ();
                Type [] types = a.GetExportedTypes ();
+               Array.Sort (types, new TypeSorter ());
 
                foreach (Type t in types)
                        Console.WriteLine (t.FullName);
index 74bd8a4cf1f4ad27523feb291717f4f6b7cd8190..b2d261fd19b5aca3c0a91ae7535244438ce3f7db 100644 (file)
@@ -1,2 +1,3 @@
 monop.cs
 outline.cs
+TypeSorter.cs