From 5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 23 Jul 2018 14:21:40 -0700 Subject: Integrate Extensibility.Data namespace change from Extensibility repo --- .../CommandLine/CommandLineParser.cs | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/WixToolset.Core/CommandLine/CommandLineParser.cs') diff --git a/src/WixToolset.Core/CommandLine/CommandLineParser.cs b/src/WixToolset.Core/CommandLine/CommandLineParser.cs index 65aea1fc..92944ab2 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineParser.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineParser.cs @@ -7,6 +7,7 @@ namespace WixToolset.Core.CommandLine using System.IO; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; internal enum Commands @@ -19,27 +20,34 @@ namespace WixToolset.Core.CommandLine Bind, } - internal class CommandLineParser : ICommandLine + internal class CommandLineParser : ICommandLineParser { - private IServiceProvider ServiceProvider { get; set; } + public CommandLineParser(IServiceProvider serviceProvider) + { + this.ServiceProvider = serviceProvider; + + this.Messaging = this.ServiceProvider.GetService(); + } + + private IServiceProvider ServiceProvider { get; } private IMessaging Messaging { get; set; } + public IExtensionManager ExtensionManager { get; set; } + + public ICommandLineArguments Arguments { get; set; } + public static string ExpectedArgument { get; } = "expected argument"; public string ActiveCommand { get; private set; } - public IExtensionManager ExtensionManager { get; private set; } - - public bool ShowHelp { get; set; } + public bool ShowHelp { get; private set; } - public ICommandLineCommand ParseStandardCommandLine(ICommandLineContext context) + public ICommandLineCommand ParseStandardCommandLine() { - this.ServiceProvider = context.ServiceProvider; - - this.Messaging = context.Messaging ?? this.ServiceProvider.GetService(); - - this.ExtensionManager = context.ExtensionManager ?? this.ServiceProvider.GetService(); + var context = this.ServiceProvider.GetService(); + context.ExtensionManager = this.ExtensionManager ?? this.ServiceProvider.GetService(); + context.Arguments = this.Arguments; var next = String.Empty; @@ -277,7 +285,7 @@ namespace WixToolset.Core.CommandLine return OutputType.Unknown; } - private ICommandLine Parse(ICommandLineContext context, Func parseCommand, Func parseArgument) + private ICommandLineParser Parse(ICommandLineContext context, Func parseCommand, Func parseArgument) { var extensions = this.ExtensionManager.Create(); -- cgit v1.2.3-55-g6feb