diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-08 21:53:58 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-08 22:11:35 +1000 |
commit | 70d112fb1ec23597b6365c3f80eec695c013960b (patch) | |
tree | e50e8845faede864ce85a684d8cb6778163a20cb /src | |
parent | 2eef1a51d1852a284cdd2c6fc1ba54c98ee1913b (diff) | |
download | wix-70d112fb1ec23597b6365c3f80eec695c013960b.tar.gz wix-70d112fb1ec23597b6365c3f80eec695c013960b.tar.bz2 wix-70d112fb1ec23597b6365c3f80eec695c013960b.zip |
Implement ShowLogo in wixcop.
Diffstat (limited to 'src')
-rw-r--r-- | src/wixcop/CommandLine/ConvertCommand.cs | 5 | ||||
-rw-r--r-- | src/wixcop/CommandLine/HelpCommand.cs | 2 | ||||
-rw-r--r-- | src/wixcop/CommandLine/WixCopCommandLineParser.cs | 1 | ||||
-rw-r--r-- | src/wixcop/Program.cs | 12 |
4 files changed, 17 insertions, 3 deletions
diff --git a/src/wixcop/CommandLine/ConvertCommand.cs b/src/wixcop/CommandLine/ConvertCommand.cs index 8b01faa7..0a765771 100644 --- a/src/wixcop/CommandLine/ConvertCommand.cs +++ b/src/wixcop/CommandLine/ConvertCommand.cs | |||
@@ -14,7 +14,7 @@ namespace WixToolset.Tools.WixCop.CommandLine | |||
14 | { | 14 | { |
15 | private const string SettingsFileDefault = "wixcop.settings.xml"; | 15 | private const string SettingsFileDefault = "wixcop.settings.xml"; |
16 | 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 | { | 18 | { |
19 | this.ErrorsAsWarnings = new HashSet<string>(); | 19 | this.ErrorsAsWarnings = new HashSet<string>(); |
20 | this.ExemptFiles = new HashSet<string>(); | 20 | this.ExemptFiles = new HashSet<string>(); |
@@ -26,6 +26,7 @@ namespace WixToolset.Tools.WixCop.CommandLine | |||
26 | this.ServiceProvider = serviceProvider; | 26 | this.ServiceProvider = serviceProvider; |
27 | this.SettingsFile1 = settingsFile1; | 27 | this.SettingsFile1 = settingsFile1; |
28 | this.SettingsFile2 = settingsFile2; | 28 | this.SettingsFile2 = settingsFile2; |
29 | this.ShowLogo = showLogo; | ||
29 | this.SubDirectories = subDirectories; | 30 | this.SubDirectories = subDirectories; |
30 | } | 31 | } |
31 | 32 | ||
@@ -51,7 +52,7 @@ namespace WixToolset.Tools.WixCop.CommandLine | |||
51 | 52 | ||
52 | private bool SubDirectories { get; } | 53 | private bool SubDirectories { get; } |
53 | 54 | ||
54 | public bool ShowLogo => throw new NotImplementedException(); | 55 | public bool ShowLogo { get; } |
55 | 56 | ||
56 | public bool StopParsing => throw new NotImplementedException(); | 57 | public bool StopParsing => throw new NotImplementedException(); |
57 | 58 | ||
diff --git a/src/wixcop/CommandLine/HelpCommand.cs b/src/wixcop/CommandLine/HelpCommand.cs index 1505dc59..4a173cd9 100644 --- a/src/wixcop/CommandLine/HelpCommand.cs +++ b/src/wixcop/CommandLine/HelpCommand.cs | |||
@@ -8,7 +8,7 @@ namespace WixToolset.Tools.WixCop.CommandLine | |||
8 | 8 | ||
9 | internal class HelpCommand : ICommandLineCommand | 9 | internal class HelpCommand : ICommandLineCommand |
10 | { | 10 | { |
11 | public bool ShowLogo => false; | 11 | public bool ShowLogo => true; |
12 | 12 | ||
13 | public bool StopParsing => true; | 13 | public bool StopParsing => true; |
14 | 14 | ||
diff --git a/src/wixcop/CommandLine/WixCopCommandLineParser.cs b/src/wixcop/CommandLine/WixCopCommandLineParser.cs index 3d34a649..f06decee 100644 --- a/src/wixcop/CommandLine/WixCopCommandLineParser.cs +++ b/src/wixcop/CommandLine/WixCopCommandLineParser.cs | |||
@@ -49,6 +49,7 @@ namespace WixToolset.Tools.WixCop.CommandLine | |||
49 | 49 | ||
50 | return new ConvertCommand( | 50 | return new ConvertCommand( |
51 | this.serviceProvider, | 51 | this.serviceProvider, |
52 | this.showLogo, | ||
52 | this.fixErrors, | 53 | this.fixErrors, |
53 | this.indentationAmount, | 54 | this.indentationAmount, |
54 | this.searchPatterns, | 55 | this.searchPatterns, |
diff --git a/src/wixcop/Program.cs b/src/wixcop/Program.cs index e2174272..5e72f8ea 100644 --- a/src/wixcop/Program.cs +++ b/src/wixcop/Program.cs | |||
@@ -3,6 +3,7 @@ | |||
3 | namespace WixToolset.Tools.WixCop | 3 | namespace WixToolset.Tools.WixCop |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Diagnostics; | ||
6 | using WixToolset.Core; | 7 | using WixToolset.Core; |
7 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
8 | using WixToolset.Extensibility.Data; | 9 | using WixToolset.Extensibility.Data; |
@@ -54,6 +55,17 @@ namespace WixToolset.Tools.WixCop | |||
54 | var commandLine = serviceProvider.GetService<IWixCopCommandLineParser>(); | 55 | var commandLine = serviceProvider.GetService<IWixCopCommandLineParser>(); |
55 | commandLine.Arguments = arguments; | 56 | commandLine.Arguments = arguments; |
56 | var command = commandLine.ParseWixCopCommandLine(); | 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 | |||
57 | return command?.Execute() ?? 1; | 69 | return command?.Execute() ?? 1; |
58 | } | 70 | } |
59 | catch (Exception e) | 71 | catch (Exception e) |