From 02cdf55197d599d4d1fd611ad749d01f5c47a01f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 8 Jun 2020 16:26:59 -0700 Subject: Add "extension" command --- .../ExtensionCacheManagerExtensionCommandLine.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs (limited to 'src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs') diff --git a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs new file mode 100644 index 00000000..81e96718 --- /dev/null +++ b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Core.ExtensionCache +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + + /// + /// Parses the "extension" command-line command. See ExtensionCacheManagerCommand + /// for the bulk of the command-line processing. + /// + internal class ExtensionCacheManagerExtensionCommandLine : BaseExtensionCommandLine + { + public ExtensionCacheManagerExtensionCommandLine(IWixToolsetServiceProvider serviceProvider) + { + this.ServiceProvider = serviceProvider; + } + + private IWixToolsetServiceProvider ServiceProvider { get; } + + // TODO: Do something with CommandLineSwitches + public override IEnumerable CommandLineSwitches => base.CommandLineSwitches; + + public override bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command) + { + command = null; + + if ("extension".Equals(argument, StringComparison.OrdinalIgnoreCase)) + { + command = new ExtensionCacheManagerCommand(this.ServiceProvider); + } + + return command != null; + } + } +} -- cgit v1.2.3-55-g6feb