aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/WixToolset.Extensibility/Services/ICommandLineArguments.cs23
-rw-r--r--src/WixToolset.Extensibility/Services/ICommandLineContext.cs4
-rw-r--r--src/WixToolset.Extensibility/Services/IParseCommandLine.cs23
3 files changed, 42 insertions, 8 deletions
diff --git a/src/WixToolset.Extensibility/Services/ICommandLineArguments.cs b/src/WixToolset.Extensibility/Services/ICommandLineArguments.cs
new file mode 100644
index 00000000..eb1f8765
--- /dev/null
+++ b/src/WixToolset.Extensibility/Services/ICommandLineArguments.cs
@@ -0,0 +1,23 @@
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 ICommandLineArguments
8 {
9 string[] OriginalArguments { get; set; }
10
11 string[] Arguments { get; set; }
12
13 string[] Extensions { get; set; }
14
15 string ErrorArgument { get; set; }
16
17 void Populate(string commandLine);
18
19 void Populate(string[] args);
20
21 IParseCommandLine Parse();
22 }
23}
diff --git a/src/WixToolset.Extensibility/Services/ICommandLineContext.cs b/src/WixToolset.Extensibility/Services/ICommandLineContext.cs
index 27d4e6dd..84b9654f 100644
--- a/src/WixToolset.Extensibility/Services/ICommandLineContext.cs
+++ b/src/WixToolset.Extensibility/Services/ICommandLineContext.cs
@@ -12,8 +12,6 @@ namespace WixToolset.Extensibility.Services
12 12
13 IExtensionManager ExtensionManager { get; set; } 13 IExtensionManager ExtensionManager { get; set; }
14 14
15 string Arguments { get; set; } 15 ICommandLineArguments Arguments { get; set; }
16
17 string[] ParsedArguments { get; set; }
18 } 16 }
19} 17}
diff --git a/src/WixToolset.Extensibility/Services/IParseCommandLine.cs b/src/WixToolset.Extensibility/Services/IParseCommandLine.cs
index 1b23be14..3753b4f2 100644
--- a/src/WixToolset.Extensibility/Services/IParseCommandLine.cs
+++ b/src/WixToolset.Extensibility/Services/IParseCommandLine.cs
@@ -6,16 +6,29 @@ namespace WixToolset.Extensibility.Services
6 6
7 public interface IParseCommandLine 7 public interface IParseCommandLine
8 { 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>
9 bool IsSwitch(string arg); 16 bool IsSwitch(string arg);
10 17
11 bool IsSwitchAt(IEnumerable<string> args, int index); 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);
12 25
13 void GetNextArgumentOrError(ref string arg); 26 bool GetNextArgumentAsDirectoryOrError(string commandLineSwitch, IList<string> directories);
14 27
15 void GetNextArgumentOrError(IList<string> args); 28 string GetNextArgumentAsFilePathOrError(string commandLineSwitch);
16 29
17 void GetNextArgumentAsFilePathOrError(IList<string> args, string fileType); 30 bool GetNextArgumentAsFilePathOrError(string commandLineSwitch, string fileType, IList<string> paths);
18 31
19 bool TryGetNextArgumentOrError(out string arg); 32 bool TryGetNextSwitchOrArgument(out string arg);
20 } 33 }
21} 34}