Implement ShowLogo in wixcop.
Sean Hall committed
May 8, 2020 at 21:53 UTC
70d112fb1ec23597b6365c3f80eec695c013960b
4 files changed
+17
-3
src/wixcop/CommandLine/ConvertCommand.cs
+3
-2
@@ -14,7 +14,7 @@ namespace WixToolset.Tools.WixCop.CommandLine
14
{
15
private const string SettingsFileDefault = "wixcop.settings.xml";
16
17
- public ConvertCommand(IWixToolsetServiceProvider serviceProvider, bool fixErrors, int indentationAmount, List<string> searchPatterns, bool subDirectories, string settingsFile1, string settingsFile2)
17
+ public ConvertCommand(IWixToolsetServiceProvider serviceProvider, bool showLogo, bool fixErrors, int indentationAmount, List<string> searchPatterns, bool subDirectories, string settingsFile1, string settingsFile2)
18
{
19
this.ErrorsAsWarnings = new HashSet<string>();
20
this.ExemptFiles = new HashSet<string>();
@@ -26,6 +26,7 @@ namespace WixToolset.Tools.WixCop.CommandLine
26
this.ServiceProvider = serviceProvider;
27
this.SettingsFile1 = settingsFile1;
28
this.SettingsFile2 = settingsFile2;
29
+ this.ShowLogo = showLogo;
30
this.SubDirectories = subDirectories;
31
}
32
@@ -51,7 +52,7 @@ namespace WixToolset.Tools.WixCop.CommandLine
52
53
private bool SubDirectories { get; }
54
54
- public bool ShowLogo => throw new NotImplementedException();
55
+ public bool ShowLogo { get; }
56
57
public bool StopParsing => throw new NotImplementedException();
58
src/wixcop/CommandLine/HelpCommand.cs
+1
-1
@@ -8,7 +8,7 @@ namespace WixToolset.Tools.WixCop.CommandLine
8
9
internal class HelpCommand : ICommandLineCommand
10
{
11
- public bool ShowLogo => false;
11
+ public bool ShowLogo => true;
12
13
public bool StopParsing => true;
14
src/wixcop/CommandLine/WixCopCommandLineParser.cs
+1
@@ -49,6 +49,7 @@ namespace WixToolset.Tools.WixCop.CommandLine
49
50
return new ConvertCommand(
51
this.serviceProvider,
52
+ this.showLogo,
53
this.fixErrors,
54
this.indentationAmount,
55
this.searchPatterns,
src/wixcop/Program.cs
+12
@@ -3,6 +3,7 @@
3
namespace WixToolset.Tools.WixCop
4
{
5
using System;
6
+ using System.Diagnostics;
7
using WixToolset.Core;
8
using WixToolset.Extensibility;
9
using WixToolset.Extensibility.Data;
@@ -54,6 +55,17 @@ namespace WixToolset.Tools.WixCop
55
var commandLine = serviceProvider.GetService<IWixCopCommandLineParser>();
56
commandLine.Arguments = arguments;
57
var command = commandLine.ParseWixCopCommandLine();
58
+
59
+ if (command.ShowLogo)
60
+ {
61
+ var wixcopAssembly = this.GetType().Assembly;
62
+ var fv = FileVersionInfo.GetVersionInfo(wixcopAssembly.Location);
63
+
64
+ Console.WriteLine("WiX Cop version {0}", fv.FileVersion);
65
+ Console.WriteLine("Copyright (C) .NET Foundation and contributors. All rights reserved.");
66
+ Console.WriteLine();
67
+ }
68
+
69
return command?.Execute() ?? 1;
70
}
71
catch (Exception e)