diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-13 09:53:28 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-13 10:04:28 -0700 |
| commit | ce397dd68b6699092d0b038b9a8c353f1f6a425d (patch) | |
| tree | 418df2d0dbbd4e1df1e205e89935998694dacf8f /src | |
| parent | 92f24ab5d534c8615bf223099e3c27b2a991a3c7 (diff) | |
| download | wix-ce397dd68b6699092d0b038b9a8c353f1f6a425d.tar.gz wix-ce397dd68b6699092d0b038b9a8c353f1f6a425d.tar.bz2 wix-ce397dd68b6699092d0b038b9a8c353f1f6a425d.zip | |
Introduce simplified command creation methods plus xmldoc
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Extensibility/Data/ICommandLineArguments.cs | 17 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/Services/ICommandLine.cs | 26 |
2 files changed, 38 insertions, 5 deletions
diff --git a/src/WixToolset.Extensibility/Data/ICommandLineArguments.cs b/src/WixToolset.Extensibility/Data/ICommandLineArguments.cs index dfa81762..b732c648 100644 --- a/src/WixToolset.Extensibility/Data/ICommandLineArguments.cs +++ b/src/WixToolset.Extensibility/Data/ICommandLineArguments.cs | |||
| @@ -1,9 +1,12 @@ | |||
| 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. | 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 | 2 | ||
| 3 | namespace WixToolset.Extensibility.Data | 3 | namespace WixToolset.Extensibility.Data |
| 4 | { | 4 | { |
| 5 | using WixToolset.Extensibility.Services; | 5 | using WixToolset.Extensibility.Services; |
| 6 | 6 | ||
| 7 | /// <summary> | ||
| 8 | /// Parsed command-line arguments. | ||
| 9 | /// </summary> | ||
| 7 | public interface ICommandLineArguments | 10 | public interface ICommandLineArguments |
| 8 | { | 11 | { |
| 9 | string[] OriginalArguments { get; set; } | 12 | string[] OriginalArguments { get; set; } |
| @@ -14,10 +17,22 @@ namespace WixToolset.Extensibility.Data | |||
| 14 | 17 | ||
| 15 | string ErrorArgument { get; set; } | 18 | string ErrorArgument { get; set; } |
| 16 | 19 | ||
| 20 | /// <summary> | ||
| 21 | /// Populate this argument from a string. | ||
| 22 | /// </summary> | ||
| 23 | /// <param name="commandLine">String to parse.</param> | ||
| 17 | void Populate(string commandLine); | 24 | void Populate(string commandLine); |
| 18 | 25 | ||
| 26 | /// <summary> | ||
| 27 | /// Populate this argument from array of strings. | ||
| 28 | /// </summary> | ||
| 29 | /// <param name="args">Array of strings.</param> | ||
| 19 | void Populate(string[] args); | 30 | void Populate(string[] args); |
| 20 | 31 | ||
| 32 | /// <summary> | ||
| 33 | /// Parses this arguments after it is populated. | ||
| 34 | /// </summary> | ||
| 35 | /// <returns>Parser for this arguments.</returns> | ||
| 21 | ICommandLineParser Parse(); | 36 | ICommandLineParser Parse(); |
| 22 | } | 37 | } |
| 23 | } | 38 | } |
diff --git a/src/WixToolset.Extensibility/Services/ICommandLine.cs b/src/WixToolset.Extensibility/Services/ICommandLine.cs index 48f3620f..2b841af0 100644 --- a/src/WixToolset.Extensibility/Services/ICommandLine.cs +++ b/src/WixToolset.Extensibility/Services/ICommandLine.cs | |||
| @@ -1,15 +1,33 @@ | |||
| 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. | 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 | 2 | ||
| 3 | namespace WixToolset.Extensibility.Services | 3 | namespace WixToolset.Extensibility.Services |
| 4 | { | 4 | { |
| 5 | using WixToolset.Extensibility.Data; | 5 | using WixToolset.Extensibility.Data; |
| 6 | 6 | ||
| 7 | /// <summary> | ||
| 8 | /// Command-line parsing mechanism. | ||
| 9 | /// </summary> | ||
| 7 | public interface ICommandLine | 10 | public interface ICommandLine |
| 8 | { | 11 | { |
| 9 | IExtensionManager ExtensionManager { get; set; } | 12 | /// <summary> |
| 13 | /// Simple way to parse arguments and create a command. | ||
| 14 | /// </summary> | ||
| 15 | /// <param name="args">Unparsed arguments.</param> | ||
| 16 | /// <returns>Command if the command-line arguments can be parsed, otherwise null.</returns> | ||
| 17 | ICommandLineCommand CreateCommand(string[] args); | ||
| 10 | 18 | ||
| 11 | ICommandLineArguments Arguments { get; set; } | 19 | /// <summary> |
| 20 | /// Simple way to parse arguments and create a command. | ||
| 21 | /// </summary> | ||
| 22 | /// <param name="commandLine">Unparsed arguments.</param> | ||
| 23 | /// <returns>Command if the command-line arguments can be parsed, otherwise null.</returns> | ||
| 24 | ICommandLineCommand CreateCommand(string commandLine); | ||
| 12 | 25 | ||
| 13 | ICommandLineCommand ParseStandardCommandLine(); | 26 | /// <summary> |
| 27 | /// Creates a command from populated arguments. | ||
| 28 | /// </summary> | ||
| 29 | /// <param name="arguments">Parsed arguments.</param> | ||
| 30 | /// <returns>Command if the command-line arguments can be parsed, otherwise null.</returns> | ||
| 31 | ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments); | ||
| 14 | } | 32 | } |
| 15 | } | 33 | } |
