| 1 | // 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. |
| 2 | |
| 3 | namespace WixToolset.Extensibility |
| 4 | { |
| 5 | using WixToolset.Extensibility.Data; |
| 6 | using WixToolset.Extensibility.Services; |
| 7 | |
| 8 | /// <summary> |
| 9 | /// Interface extensions implement to be able to parse the command-line. |
| 10 | /// </summary> |
| 11 | public interface IExtensionCommandLine |
| 12 | { |
| 13 | /// <summary> |
| 14 | /// Gets the help for this extension. |
| 15 | /// </summary> |
| 16 | CommandLineHelp GetCommandLineHelp(); |
| 17 | |
| 18 | /// <summary> |
| 19 | /// Called before the command-line is parsed. |
| 20 | /// </summary> |
| 21 | /// <param name="context">Information about the command-line to be parsed.</param> |
| 22 | void PreParse(ICommandLineContext context); |
| 23 | |
| 24 | /// <summary> |
| 25 | /// Gives the extension an opportunity pass a command-line argument for another command. |
| 26 | /// </summary> |
| 27 | /// <param name="parser">Parser to help parse the argument and additional arguments.</param> |
| 28 | /// <param name="argument">Argument to parse.</param> |
| 29 | /// <returns>True if the argument is recognized; otherwise false to allow another extension to process it.</returns> |
| 30 | bool TryParseArgument(ICommandLineParser parser, string argument); |
| 31 | |
| 32 | /// <summary> |
| 33 | /// Gives the extension an opportunity to provide a command. |
| 34 | /// </summary> |
| 35 | /// <param name="parser">Parser to help parse the argument and additional arguments.</param> |
| 36 | /// <param name="argument">Argument to parse.</param> |
| 37 | /// <param name="command"></param> |
| 38 | /// <returns>True if the argument is recognized as a command; otherwise false to allow another extension to process it.</returns> |
| 39 | bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command); |
| 40 | |
| 41 | /// <summary> |
| 42 | /// Called after the command-line is parsed. |
| 43 | /// </summary> |
| 44 | void PostParse(); |
| 45 | } |
| 46 | } |