aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Extensibility/Services
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Extensibility/Services')
-rw-r--r--src/WixToolset.Extensibility/Services/ICommandLine.cs15
-rw-r--r--src/WixToolset.Extensibility/Services/ICommandLineParser.cs31
-rw-r--r--src/WixToolset.Extensibility/Services/IParseCommandLine.cs34
3 files changed, 41 insertions, 39 deletions
diff --git a/src/WixToolset.Extensibility/Services/ICommandLine.cs b/src/WixToolset.Extensibility/Services/ICommandLine.cs
new file mode 100644
index 00000000..48f3620f
--- /dev/null
+++ b/src/WixToolset.Extensibility/Services/ICommandLine.cs
@@ -0,0 +1,15 @@
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
3namespace WixToolset.Extensibility.Services
4{
5 using WixToolset.Extensibility.Data;
6
7 public interface ICommandLine
8 {
9 IExtensionManager ExtensionManager { get; set; }
10
11 ICommandLineArguments Arguments { get; set; }
12
13 ICommandLineCommand ParseStandardCommandLine();
14 }
15}
diff --git a/src/WixToolset.Extensibility/Services/ICommandLineParser.cs b/src/WixToolset.Extensibility/Services/ICommandLineParser.cs
index 60507c6c..f7e2a28f 100644
--- a/src/WixToolset.Extensibility/Services/ICommandLineParser.cs
+++ b/src/WixToolset.Extensibility/Services/ICommandLineParser.cs
@@ -1,15 +1,36 @@
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
3namespace WixToolset.Extensibility.Services 3namespace WixToolset.Extensibility.Services
4{ 4{
5 using WixToolset.Extensibility.Data; 5 using System.Collections.Generic;
6 6
7 public interface ICommandLineParser 7 public interface ICommandLineParser
8 { 8 {
9 IExtensionManager ExtensionManager { get; set; } 9 string ErrorArgument { get; set; }
10 10
11 ICommandLineArguments Arguments { get; set; } 11 /// <summary>
12 /// Validates that a valid switch (starts with "/" or "-"), and returns a bool indicating its validity
13 /// </summary>
14 /// <param name="arg">The string check.</param>
15 /// <returns>True if a valid switch, otherwise false.</returns>
16 bool IsSwitch(string arg);
12 17
13 ICommandLineCommand ParseStandardCommandLine(); 18 string GetArgumentAsFilePathOrError(string argument, string fileType);
19
20 void GetArgumentAsFilePathOrError(string argument, string fileType, IList<string> paths);
21
22 string GetNextArgumentOrError(string commandLineSwitch);
23
24 bool GetNextArgumentOrError(string commandLineSwitch, IList<string> argument);
25
26 string GetNextArgumentAsDirectoryOrError(string commandLineSwitch);
27
28 bool GetNextArgumentAsDirectoryOrError(string commandLineSwitch, IList<string> directories);
29
30 string GetNextArgumentAsFilePathOrError(string commandLineSwitch);
31
32 bool GetNextArgumentAsFilePathOrError(string commandLineSwitch, string fileType, IList<string> paths);
33
34 bool TryGetNextSwitchOrArgument(out string arg);
14 } 35 }
15} 36}
diff --git a/src/WixToolset.Extensibility/Services/IParseCommandLine.cs b/src/WixToolset.Extensibility/Services/IParseCommandLine.cs
deleted file mode 100644
index 3753b4f2..00000000
--- a/src/WixToolset.Extensibility/Services/IParseCommandLine.cs
+++ /dev/null
@@ -1,34 +0,0 @@
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
3namespace WixToolset.Extensibility.Services
4{
5 using System.Collections.Generic;
6
7 public interface IParseCommandLine
8 {
9 string ErrorArgument { get; set; }
10
11 /// <summary>
12 /// Validates that a valid switch (starts with "/" or "-"), and returns a bool indicating its validity
13 /// </summary>
14 /// <param name="arg">The string check.</param>
15 /// <returns>True if a valid switch, otherwise false.</returns>
16 bool IsSwitch(string arg);
17
18 void GetArgumentAsFilePathOrError(string argument, string fileType, IList<string> paths);
19
20 string GetNextArgumentOrError(string commandLineSwitch);
21
22 bool GetNextArgumentOrError(string commandLineSwitch, IList<string> argument);
23
24 string GetNextArgumentAsDirectoryOrError(string commandLineSwitch);
25
26 bool GetNextArgumentAsDirectoryOrError(string commandLineSwitch, IList<string> directories);
27
28 string GetNextArgumentAsFilePathOrError(string commandLineSwitch);
29
30 bool GetNextArgumentAsFilePathOrError(string commandLineSwitch, string fileType, IList<string> paths);
31
32 bool TryGetNextSwitchOrArgument(out string arg);
33 }
34}