diff options
author | Rob Mensching <rob@firegiant.com> | 2020-06-06 15:24:04 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2020-06-08 16:34:16 -0700 |
commit | de389d8c8803c3d2fbbf65620695be30fa24754e (patch) | |
tree | 88740a12432eb641e3e9199cb8dce93e1c32398e /src | |
parent | 59e358df2f15d478e5bd9f48e3e0824d8a59d7f4 (diff) | |
download | wix-de389d8c8803c3d2fbbf65620695be30fa24754e.tar.gz wix-de389d8c8803c3d2fbbf65620695be30fa24754e.tar.bz2 wix-de389d8c8803c3d2fbbf65620695be30fa24754e.zip |
Add the argument to command command-line processing and add xmldoc
Diffstat (limited to 'src')
3 files changed, 44 insertions, 4 deletions
diff --git a/src/WixToolset.Extensibility/BaseExtensionCommandLine.cs b/src/WixToolset.Extensibility/BaseExtensionCommandLine.cs index 77e8a5bd..5f2ca109 100644 --- a/src/WixToolset.Extensibility/BaseExtensionCommandLine.cs +++ b/src/WixToolset.Extensibility/BaseExtensionCommandLine.cs | |||
@@ -9,7 +9,7 @@ namespace WixToolset.Extensibility | |||
9 | 9 | ||
10 | public abstract class BaseExtensionCommandLine : IExtensionCommandLine | 10 | public abstract class BaseExtensionCommandLine : IExtensionCommandLine |
11 | { | 11 | { |
12 | public IEnumerable<ExtensionCommandLineSwitch> CommandLineSwitches => Enumerable.Empty<ExtensionCommandLineSwitch>(); | 12 | public virtual IEnumerable<ExtensionCommandLineSwitch> CommandLineSwitches => Enumerable.Empty<ExtensionCommandLineSwitch>(); |
13 | 13 | ||
14 | public virtual void PostParse() | 14 | public virtual void PostParse() |
15 | { | 15 | { |
@@ -24,7 +24,7 @@ namespace WixToolset.Extensibility | |||
24 | return false; | 24 | return false; |
25 | } | 25 | } |
26 | 26 | ||
27 | public virtual bool TryParseCommand(ICommandLineParser parser, out ICommandLineCommand command) | 27 | public virtual bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command) |
28 | { | 28 | { |
29 | command = null; | 29 | command = null; |
30 | return false; | 30 | return false; |
diff --git a/src/WixToolset.Extensibility/Data/ICommandLineCommand.cs b/src/WixToolset.Extensibility/Data/ICommandLineCommand.cs index 1c6de205..a0fc9454 100644 --- a/src/WixToolset.Extensibility/Data/ICommandLineCommand.cs +++ b/src/WixToolset.Extensibility/Data/ICommandLineCommand.cs | |||
@@ -4,14 +4,33 @@ namespace WixToolset.Extensibility.Data | |||
4 | { | 4 | { |
5 | using WixToolset.Extensibility.Services; | 5 | using WixToolset.Extensibility.Services; |
6 | 6 | ||
7 | /// <summary> | ||
8 | /// Custom command. | ||
9 | /// </summary> | ||
7 | public interface ICommandLineCommand | 10 | public interface ICommandLineCommand |
8 | { | 11 | { |
12 | /// <summary> | ||
13 | /// Indicates the command-line should show the command-line logo. | ||
14 | /// </summary> | ||
9 | bool ShowLogo { get; } | 15 | bool ShowLogo { get; } |
10 | 16 | ||
17 | /// <summary> | ||
18 | /// Indicates the command-line parsing can stop. | ||
19 | /// </summary> | ||
11 | bool StopParsing { get; } | 20 | bool StopParsing { get; } |
12 | 21 | ||
22 | /// <summary> | ||
23 | /// Executes the command. | ||
24 | /// </summary> | ||
25 | /// <returns>Exit code for the command.</returns> | ||
13 | int Execute(); | 26 | int Execute(); |
14 | 27 | ||
28 | /// <summary> | ||
29 | /// Allows the command to parse command-line arguments. | ||
30 | /// </summary> | ||
31 | /// <param name="parser">Parser to help parse the argument and additional arguments.</param> | ||
32 | /// <param name="argument">Argument to parse.</param> | ||
33 | /// <returns>True if the argument is recognized; otherwise false to allow another extension to process it.</returns> | ||
15 | bool TryParseArgument(ICommandLineParser parser, string argument); | 34 | bool TryParseArgument(ICommandLineParser parser, string argument); |
16 | } | 35 | } |
17 | } | 36 | } |
diff --git a/src/WixToolset.Extensibility/IExtensionCommandLine.cs b/src/WixToolset.Extensibility/IExtensionCommandLine.cs index 0cbf84d9..45683373 100644 --- a/src/WixToolset.Extensibility/IExtensionCommandLine.cs +++ b/src/WixToolset.Extensibility/IExtensionCommandLine.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Extensibility | |||
7 | using WixToolset.Extensibility.Services; | 7 | using WixToolset.Extensibility.Services; |
8 | 8 | ||
9 | /// <summary> | 9 | /// <summary> |
10 | /// Interface extensions implement to be able to parse command-line options. | 10 | /// Interface extensions implement to be able to parse the command-line. |
11 | /// </summary> | 11 | /// </summary> |
12 | public interface IExtensionCommandLine | 12 | public interface IExtensionCommandLine |
13 | { | 13 | { |
@@ -17,12 +17,33 @@ namespace WixToolset.Extensibility | |||
17 | /// <value>The supported command line types for this extension.</value> | 17 | /// <value>The supported command line types for this extension.</value> |
18 | IEnumerable<ExtensionCommandLineSwitch> CommandLineSwitches { get; } | 18 | IEnumerable<ExtensionCommandLineSwitch> CommandLineSwitches { get; } |
19 | 19 | ||
20 | /// <summary> | ||
21 | /// Called before the command-line is parsed. | ||
22 | /// </summary> | ||
23 | /// <param name="context">Information about the command-line to be parsed.</param> | ||
20 | void PreParse(ICommandLineContext context); | 24 | void PreParse(ICommandLineContext context); |
21 | 25 | ||
26 | /// <summary> | ||
27 | /// Gives the extension an opportunity pass a command-line argument for another command. | ||
28 | /// </summary> | ||
29 | /// <param name="parser">Parser to help parse the argument and additional arguments.</param> | ||
30 | /// <param name="argument">Argument to parse.</param> | ||
31 | /// <returns>True if the argument is recognized; otherwise false to allow another extension to process it.</returns> | ||
22 | bool TryParseArgument(ICommandLineParser parser, string argument); | 32 | bool TryParseArgument(ICommandLineParser parser, string argument); |
23 | 33 | ||
24 | bool TryParseCommand(ICommandLineParser parser, out ICommandLineCommand command); | 34 | /// <summary> |
35 | /// Gives the extension an opportunity to provide a command. | ||
36 | /// </summary> | ||
37 | /// </summary> | ||
38 | /// <param name="parser">Parser to help parse the argument and additional arguments.</param> | ||
39 | /// <param name="argument">Argument to parse.</param> | ||
40 | /// <param name="command"></param> | ||
41 | /// <returns>True if the argument is recognized as a commond; otherwise false to allow another extension to process it.</returns> | ||
42 | bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command); | ||
25 | 43 | ||
44 | /// <summary> | ||
45 | /// Called after the command-line is parsed. | ||
46 | /// </summary> | ||
26 | void PostParse(); | 47 | void PostParse(); |
27 | } | 48 | } |
28 | } | 49 | } |