diff options
author | Rob Mensching <rob@firegiant.com> | 2021-01-08 15:33:06 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-01-08 15:47:31 -0800 |
commit | c941c5365e59127274f53b329da53c052aad0215 (patch) | |
tree | e75257991a0398251a9f0583857e55ab85272661 | |
parent | 4de24fe6e542391a9cdd55b00df9a1664273c5e2 (diff) | |
download | wix-c941c5365e59127274f53b329da53c052aad0215.tar.gz wix-c941c5365e59127274f53b329da53c052aad0215.tar.bz2 wix-c941c5365e59127274f53b329da53c052aad0215.zip |
Add support for -wx switch to decompiler
-rw-r--r-- | src/WixToolset.Core/CommandLine/DecompileCommand.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/WixToolset.Core/CommandLine/DecompileCommand.cs b/src/WixToolset.Core/CommandLine/DecompileCommand.cs index 873c85ee..393e2a4e 100644 --- a/src/WixToolset.Core/CommandLine/DecompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/DecompileCommand.cs | |||
@@ -139,6 +139,12 @@ namespace WixToolset.Core.CommandLine | |||
139 | } | 139 | } |
140 | return true; | 140 | return true; |
141 | } | 141 | } |
142 | |||
143 | if (parameter.StartsWith("wx")) | ||
144 | { | ||
145 | this.ParseWarningAsError(parameter, "wx".Length, parser); | ||
146 | return true; | ||
147 | } | ||
142 | } | 148 | } |
143 | else | 149 | else |
144 | { | 150 | { |
@@ -211,6 +217,23 @@ namespace WixToolset.Core.CommandLine | |||
211 | { | 217 | { |
212 | 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; |
213 | } | 219 | } |
220 | |||
221 | private void ParseWarningAsError(string parameter, int offset, ICommandLineParser parser) | ||
222 | { | ||
223 | var paramArg = parameter.Substring(offset); | ||
224 | if (paramArg.Length == 0) | ||
225 | { | ||
226 | this.Messaging.WarningsAsError = true; | ||
227 | } | ||
228 | else if (Int32.TryParse(paramArg, out var elevateWarning) && elevateWarning > 0) | ||
229 | { | ||
230 | this.Messaging.SuppressWarningMessage(elevateWarning); | ||
231 | } | ||
232 | else | ||
233 | { | ||
234 | parser.ReportErrorArgument(parameter, ErrorMessages.IllegalSuppressWarningId(paramArg)); | ||
235 | } | ||
236 | } | ||
214 | } | 237 | } |
215 | } | 238 | } |
216 | } | 239 | } |