main
cs 44 lines 1.58 KB
Raw
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.Data
4 {
5 using System.Threading;
6 using System.Threading.Tasks;
7 using WixToolset.Extensibility.Services;
8
9 /// <summary>
10 /// Custom command.
11 /// </summary>
12 public interface ICommandLineCommand
13 {
14 /// <summary>
15 /// Indicates the command-line should show the logo.
16 /// </summary>
17 bool ShowLogo { get; }
18
19 /// <summary>
20 /// Indicates the command-line parsing can stop.
21 /// </summary>
22 bool StopParsing { get; }
23
24 /// <summary>
25 /// Gets the help for this command.
26 /// </summary>
27 CommandLineHelp GetCommandLineHelp();
28
29 /// <summary>
30 /// Executes the command.
31 /// </summary>
32 /// <param name="cancellationToken">Cancellation token.</param>
33 /// <returns>Exit code for the command.</returns>
34 Task<int> ExecuteAsync(CancellationToken cancellationToken);
35
36 /// <summary>
37 /// Allows the command to parse command-line arguments.
38 /// </summary>
39 /// <param name="parser">Parser to help parse the argument and additional arguments.</param>
40 /// <param name="argument">Argument to parse.</param>
41 /// <returns>True if the argument is recognized; otherwise false to allow another extension to process it.</returns>
42 bool TryParseArgument(ICommandLineParser parser, string argument);
43 }
44 }