diff options
author | Lluis Sanchez <lluis@novell.com> | 2009-06-18 01:36:01 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2009-06-18 01:36:01 +0400 |
commit | d73e46f174c104d249b2d366609be0c28a2b2890 (patch) | |
tree | fa0675258803cc48e8ca493e4a9bc5fdd84f60fb /mautil | |
parent | 7d1ebc5c10b1504164ddf32ee8791058fc160882 (diff) |
* Main.cs: Added arguments which allows specifying the add-in
registry location using a package name.
svn path=/trunk/mono-addins/; revision=136360
Diffstat (limited to 'mautil')
-rw-r--r-- | mautil/ChangeLog | 5 | ||||
-rw-r--r-- | mautil/Main.cs | 36 |
2 files changed, 36 insertions, 5 deletions
diff --git a/mautil/ChangeLog b/mautil/ChangeLog index b996097..5b3765f 100644 --- a/mautil/ChangeLog +++ b/mautil/ChangeLog @@ -1,3 +1,8 @@ +2009-06-17 Lluis Sanchez Gual <lluis@novell.com> + + * Main.cs: Added arguments which allows specifying the add-in + registry location using a package name. + 2009/02/06 Lluis Sanchez Gual <lluis@novell.com> * mautil.csproj: Updated. diff --git a/mautil/Main.cs b/mautil/Main.cs index 48f3945..2e1f494 100644 --- a/mautil/Main.cs +++ b/mautil/Main.cs @@ -1,5 +1,6 @@ // project created on 16/07/2006 at 13:33 using System; +using System.Diagnostics; using Mono.Addins; using Mono.Addins.Setup; @@ -15,7 +16,8 @@ namespace mautil Console.WriteLine (); Console.WriteLine ("Options:"); Console.WriteLine (" --registry (-reg) Specify add-in registry path"); - Console.WriteLine (" --path (-p) Specify startup path"); + Console.WriteLine (" --path (-p) Specify startup path of the application"); + Console.WriteLine (" --package (-pkg) Specify the package name of the application"); Console.WriteLine (" -v Verbose output"); } @@ -28,6 +30,7 @@ namespace mautil string path = null; string startupPath = null; + string package = null; bool toolParam = true; while (toolParam && ppos < args.Length) @@ -40,7 +43,7 @@ namespace mautil path = args [ppos + 1]; ppos += 2; } - if (args [ppos] == "-p" || args [ppos] == "--path") { + else if (args [ppos] == "-p" || args [ppos] == "--path") { if (ppos + 1 >= args.Length) { Console.WriteLine ("Startup path not provided."); return 1; @@ -48,6 +51,14 @@ namespace mautil startupPath = args [ppos + 1]; ppos += 2; } + else if (args [ppos] == "-pkg" || args [ppos] == "--package") { + if (ppos + 1 >= args.Length) { + Console.WriteLine ("Package name not provided."); + return 1; + } + package = args [ppos + 1]; + ppos += 2; + } else if (args [ppos] == "-v") { verbose = true; ppos++; @@ -55,10 +66,25 @@ namespace mautil toolParam = false; } - if (startupPath == null) - startupPath = Environment.CurrentDirectory; + AddinRegistry reg; + + if (package != null) { + if (startupPath != null || path != null) { + Console.WriteLine ("The --registry and --path options can't be used when --package is specified."); + return 1; + } + reg = SetupService.GetRegistryForPackage (package); + if (reg == null) { + Console.WriteLine ("The package could not be found or does not provide add-in registry information."); + return 1; + } + } + else { + if (startupPath == null) + startupPath = Environment.CurrentDirectory; + reg = path != null ? new AddinRegistry (path, startupPath) : AddinRegistry.GetGlobalRegistry (); + } - AddinRegistry reg = path != null ? new AddinRegistry (path, startupPath) : AddinRegistry.GetGlobalRegistry (); try { SetupTool setupTool = new SetupTool (reg); setupTool.VerboseOutput = verbose; |