diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-01-19 15:38:47 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-01-19 15:56:43 -0600 |
| commit | 453107d72fa96e7b942ef4698ab10e4bcac91d2e (patch) | |
| tree | 3f3f0ba134746a83493607f1567510da1c87ad38 /src/WixToolset.Core/CommandLine | |
| parent | c941c5365e59127274f53b329da53c052aad0215 (diff) | |
| download | wix-453107d72fa96e7b942ef4698ab10e4bcac91d2e.tar.gz wix-453107d72fa96e7b942ef4698ab10e4bcac91d2e.tar.bz2 wix-453107d72fa96e7b942ef4698ab10e4bcac91d2e.zip | |
Use new logic for -sw in DecompileCommand.
Diffstat (limited to 'src/WixToolset.Core/CommandLine')
| -rw-r--r-- | src/WixToolset.Core/CommandLine/DecompileCommand.cs | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/src/WixToolset.Core/CommandLine/DecompileCommand.cs b/src/WixToolset.Core/CommandLine/DecompileCommand.cs index 393e2a4e..06402a13 100644 --- a/src/WixToolset.Core/CommandLine/DecompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/DecompileCommand.cs | |||
| @@ -128,19 +128,19 @@ namespace WixToolset.Core.CommandLine | |||
| 128 | case "verbose": | 128 | case "verbose": |
| 129 | this.Messaging.ShowVerboseMessages = true; | 129 | this.Messaging.ShowVerboseMessages = true; |
| 130 | return true; | 130 | return true; |
| 131 | } | ||
| 131 | 132 | ||
| 132 | case "sw": | 133 | if (parameter.StartsWith("sw")) |
| 133 | case "suppresswarning": | 134 | { |
| 134 | var warning = parser.GetNextArgumentOrError(arg); | 135 | this.ParseSuppressWarning(parameter, "sw".Length, parser); |
| 135 | if (!String.IsNullOrEmpty(warning)) | ||
| 136 | { | ||
| 137 | var warningNumber = Convert.ToInt32(warning); | ||
| 138 | this.Messaging.SuppressWarningMessage(warningNumber); | ||
| 139 | } | ||
| 140 | return true; | 136 | return true; |
| 141 | } | 137 | } |
| 142 | 138 | else if (parameter.StartsWith("suppresswarning")) | |
| 143 | if (parameter.StartsWith("wx")) | 139 | { |
| 140 | this.ParseSuppressWarning(parameter, "suppresswarning".Length, parser); | ||
| 141 | return true; | ||
| 142 | } | ||
| 143 | else if (parameter.StartsWith("wx")) | ||
| 144 | { | 144 | { |
| 145 | this.ParseWarningAsError(parameter, "wx".Length, parser); | 145 | this.ParseWarningAsError(parameter, "wx".Length, parser); |
| 146 | return true; | 146 | return true; |
| @@ -218,6 +218,23 @@ namespace WixToolset.Core.CommandLine | |||
| 218 | return String.IsNullOrEmpty(this.OutputFile) ? Path.ChangeExtension(this.DecompileFilePath, ".wxs") : this.OutputFile; | 218 | return String.IsNullOrEmpty(this.OutputFile) ? Path.ChangeExtension(this.DecompileFilePath, ".wxs") : this.OutputFile; |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | private void ParseSuppressWarning(string parameter, int offset, ICommandLineParser parser) | ||
| 222 | { | ||
| 223 | var paramArg = parameter.Substring(offset); | ||
| 224 | if (paramArg.Length == 0) | ||
| 225 | { | ||
| 226 | this.Messaging.SuppressAllWarnings = true; | ||
| 227 | } | ||
| 228 | else if (Int32.TryParse(paramArg, out var suppressWarning) && suppressWarning > 0) | ||
| 229 | { | ||
| 230 | this.Messaging.SuppressWarningMessage(suppressWarning); | ||
| 231 | } | ||
| 232 | else | ||
| 233 | { | ||
| 234 | parser.ReportErrorArgument(parameter, ErrorMessages.IllegalSuppressWarningId(paramArg)); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | |||
| 221 | private void ParseWarningAsError(string parameter, int offset, ICommandLineParser parser) | 238 | private void ParseWarningAsError(string parameter, int offset, ICommandLineParser parser) |
| 222 | { | 239 | { |
| 223 | var paramArg = parameter.Substring(offset); | 240 | var paramArg = parameter.Substring(offset); |
