From f4cefb9ac9a6911ee0a1ad035e6ee50b7f28e5c5 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 18 Jul 2020 14:55:58 -0700 Subject: Display command-line help from Core and extensions Closes wixtoolset/issues#6211 --- .../ExtensionCacheManagerCommand.cs | 21 ++++++++++++++++----- .../ExtensionCacheManagerExtensionCommandLine.cs | 6 ++++-- 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'src/WixToolset.Core.ExtensionCache') diff --git a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerCommand.cs b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerCommand.cs index 24f17d06..67c1504b 100644 --- a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerCommand.cs +++ b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerCommand.cs @@ -96,12 +96,15 @@ namespace WixToolset.Core.ExtensionCache switch (parameter.ToLowerInvariant()) { case "?": + case "h": + case "-help": this.ShowHelp = true; this.ShowLogo = true; this.StopParsing = true; return true; case "nologo": + case "-nologo": this.ShowLogo = false; return true; @@ -158,13 +161,21 @@ namespace WixToolset.Core.ExtensionCache private static void DisplayHelp() { - Console.WriteLine(" usage: wix.exe extension add|remove|list [extensionRef]"); Console.WriteLine(); - Console.WriteLine(" -g add/remove the extension for the current user"); - Console.WriteLine(" -nologo suppress displaying the logo information"); - Console.WriteLine(" -? this help information"); + Console.WriteLine("Usage: wix extension add|remove|list [extensionRef]"); Console.WriteLine(); - Console.WriteLine(" extensionRef format: extensionId/version (the version is optional)"); + Console.WriteLine("Options:"); + Console.WriteLine(" -h|--help Show command line help."); + Console.WriteLine(" -g|--global Add/remove the extension for the current user."); + Console.WriteLine(" --nologo Suppress displaying the logo information."); + Console.WriteLine(); + Console.WriteLine("Commands:"); + Console.WriteLine(); + Console.WriteLine(" add Add extension to the cache."); + Console.WriteLine(" list List extensions in the cache."); + Console.WriteLine(" remove Remove extension from the cache."); + Console.WriteLine(); + Console.WriteLine(" extensionRef format: extensionId/version (the version is optional)"); } } } diff --git a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs index 81e96718..a27e2a1f 100644 --- a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs +++ b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs @@ -21,8 +21,10 @@ namespace WixToolset.Core.ExtensionCache private IWixToolsetServiceProvider ServiceProvider { get; } - // TODO: Do something with CommandLineSwitches - public override IEnumerable CommandLineSwitches => base.CommandLineSwitches; + public override IEnumerable CommandLineSwitches => new ExtensionCommandLineSwitch[] + { + new ExtensionCommandLineSwitch { Switch = "extension", Description = "Manage extension cache." }, + }; public override bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command) { -- cgit v1.2.3-55-g6feb