@joebigelow / wix-1 / commits / 85fc7be6

Update to changes to reorganize command-line processing

Rob Mensching committed Oct 24, 2018 at 21:07 UTC 85fc7be678248a0a5873c08d48941021eb0959e6
5 files changed +22 -6
src/WixToolset.BuildTasks/DoIt.cs
+1 -1
@@ -172,7 +172,7 @@ namespace WixToolset.BuildTasks
172 var arguments = serviceProvider.GetService<ICommandLineArguments>();
173 arguments.Populate(commandLineString);
174
175 - var commandLine = serviceProvider.GetService<ICommandLineParser>();
175 + var commandLine = serviceProvider.GetService<ICommandLine>();
176 commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions);
177 commandLine.Arguments = arguments;
178 var command = commandLine.ParseStandardCommandLine();
src/wix/Program.cs
+1 -4
@@ -3,11 +3,8 @@
3 namespace WixToolset.Tools
4 {
5 using System;
6 - using System.Globalization;
6 using System.Linq;
7 using System.Reflection;
9 - using System.Text;
10 - using System.Threading;
8 using WixToolset.Core;
9 using WixToolset.Data;
10 using WixToolset.Extensibility;
@@ -50,7 +47,7 @@ namespace WixToolset.Tools
47 var arguments = serviceProvider.GetService<ICommandLineArguments>();
48 arguments.Populate(args);
49
53 - var commandLine = serviceProvider.GetService<ICommandLineParser>();
50 + var commandLine = serviceProvider.GetService<ICommandLine>();
51 commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions);
52 commandLine.Arguments = arguments;
53 var command = commandLine.ParseStandardCommandLine();
src/wixcop/CommandLine/ConvertCommand.cs
+9
@@ -50,6 +50,15 @@ namespace WixToolset.Tools.WixCop.CommandLine
50
51 private bool SubDirectories { get; }
52
53 + public bool ShowLogo => throw new NotImplementedException();
54 +
55 + public bool StopParsing => throw new NotImplementedException();
56 +
57 + public bool TryParseArgument(ICommandLineParser parser, string argument)
58 + {
59 + throw new NotImplementedException();
60 + }
61 +
62 public int Execute()
63 {
64 // parse the settings if any were specified
src/wixcop/CommandLine/HelpCommand.cs
+10
@@ -4,9 +4,14 @@ namespace WixToolset.Tools.WixCop.CommandLine
4 {
5 using System;
6 using WixToolset.Extensibility.Data;
7 + using WixToolset.Extensibility.Services;
8
9 internal class HelpCommand : ICommandLineCommand
10 {
11 + public bool ShowLogo => false;
12 +
13 + public bool StopParsing => true;
14 +
15 public int Execute()
16 {
17 Console.WriteLine(" usage: wixcop.exe sourceFile [sourceFile ...]");
@@ -23,5 +28,10 @@ namespace WixToolset.Tools.WixCop.CommandLine
28
29 return 0;
30 }
31 +
32 + public bool TryParseArgument(ICommandLineParser parser, string argument)
33 + {
34 + return true;
35 + }
36 }
37 }
src/wixcop/CommandLine/WixCopCommandLineParser.cs
+1 -1
@@ -85,7 +85,7 @@ namespace WixToolset.Tools.WixCop.CommandLine
85 }
86 }
87
88 - private bool ParseArgument(IParseCommandLine parser, string arg)
88 + private bool ParseArgument(ICommandLineParser parser, string arg)
89 {
90 var parameter = arg.Substring(1);
91