From 3ccd5e439da4296d6f2b66ce47075ab20d039676 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 14 Mar 2021 07:38:48 -0700 Subject: Minimize public surface area of Core Fixes wixtoolset/issues#6374 --- src/WixToolset.Core/CommandLine/CommandLine.cs | 10 +++++++--- src/WixToolset.Core/CommandLine/HelpCommand.cs | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/WixToolset.Core/CommandLine') diff --git a/src/WixToolset.Core/CommandLine/CommandLine.cs b/src/WixToolset.Core/CommandLine/CommandLine.cs index 0c21eaaa..7371628b 100644 --- a/src/WixToolset.Core/CommandLine/CommandLine.cs +++ b/src/WixToolset.Core/CommandLine/CommandLine.cs @@ -55,7 +55,9 @@ namespace WixToolset.Core.CommandLine if (command.ShowLogo) { - AppCommon.DisplayToolHeader(); + var branding = this.ServiceProvider.GetService(); + Console.WriteLine(branding.ReplacePlaceholders("[AssemblyProduct] [AssemblyDescription] version [FileVersion]")); + Console.WriteLine(branding.ReplacePlaceholders("[AssemblyCopyright]")); } return command; @@ -73,6 +75,7 @@ namespace WixToolset.Core.CommandLine private ICommandLineCommand Parse(ICommandLineContext context) { + var branding = context.ServiceProvider.GetService(); var extensions = context.ExtensionManager.GetServices(); foreach (var extension in extensions) @@ -118,7 +121,7 @@ namespace WixToolset.Core.CommandLine extension.PostParse(); } - return command ?? new HelpCommand(extensions); + return command ?? new HelpCommand(extensions, branding); } private bool TryParseCommand(string arg, ICommandLineParser parser, IEnumerable extensions, out ICommandLineCommand command) @@ -134,7 +137,8 @@ namespace WixToolset.Core.CommandLine case "h": case "help": case "-help": - command = new HelpCommand(extensions); + var branding = this.ServiceProvider.GetService(); + command = new HelpCommand(extensions, branding); break; case "version": diff --git a/src/WixToolset.Core/CommandLine/HelpCommand.cs b/src/WixToolset.Core/CommandLine/HelpCommand.cs index 3af442aa..6a5ac183 100644 --- a/src/WixToolset.Core/CommandLine/HelpCommand.cs +++ b/src/WixToolset.Core/CommandLine/HelpCommand.cs @@ -19,9 +19,10 @@ namespace WixToolset.Core.CommandLine new ExtensionCommandLineSwitch { Switch = "decompile", Description = "Decompile a package or bundle into source code." }, }; - public HelpCommand(IEnumerable extensions) + public HelpCommand(IEnumerable extensions, IWixBranding branding) { this.Extensions = extensions; + this.Branding = branding; } public bool ShowLogo => true; @@ -30,6 +31,8 @@ namespace WixToolset.Core.CommandLine private IEnumerable Extensions { get; } + private IWixBranding Branding { get; } + public Task ExecuteAsync(CancellationToken _) { var commandLineSwitches = new List(BuiltInSwitches); @@ -52,7 +55,8 @@ namespace WixToolset.Core.CommandLine Console.WriteLine(); Console.WriteLine("Run 'wix [command] --help' for more information on a command."); - AppCommon.DisplayToolFooter(); + Console.WriteLine(); + Console.WriteLine(this.Branding.ReplacePlaceholders("For more information see: [SupportUrl]")); return Task.FromResult(-1); } -- cgit v1.2.3-55-g6feb