aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/WixToolset.Core/CommandLine/DecompileCommand.cs23
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}