Skip to content

Commit 5e89a7b

Browse files
committed
Port the fix as it was lost during the merge and fixup the tests.
1 parent 8f1affa commit 5e89a7b

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/Parser.HelpColors.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public static class Colors
1919
private static IColors s_helpColors;
2020
private static object s_lockObj = new object();
2121

22-
2322
public static IColors Get(ConsoleColor backgroundColor = (ConsoleColor)(-1))
2423
{
2524
if (s_helpColors != null)

src/Parser.Internal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static void SplitCommandLineIntoSegments(string line, ref List<string> n
192192
var optionalParamName = args[offsetInArray + currentLogicalPosition].Substring(1);
193193
if (!TypeArgumentInfo.OptionalArguments.TryGetValue(optionalParamName, out optionalProp))
194194
{
195-
throw new ArgumentException($"Could not find argument {args[currentLogicalPosition]}");
195+
throw new ArgumentException($"Could not find argument {args[offsetInArray + currentLogicalPosition]}");
196196
}
197197

198198
// skip over the parameter name

test/CommandLineTests.Help.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,11 +801,12 @@ public void EnsureThatRightParameterIsReportedForGroups()
801801

802802
Validate(_printer,
803803
new TextAndColor(ConsoleColor.Red, "Error"),
804-
new TextAndColor(ConsoleColor.Black, $": Could not find argument -opt1=value {Environment.NewLine}"),
804+
new TextAndColor(ConsoleColor.Black, $": Could not find argument -opt1=value {Environment.NewLine}"),
805805
new TextAndColor(ConsoleColor.Black, "Usage: "),
806806
new TextAndColor(ConsoleColor.Black, " "),
807807
new TextAndColor(ConsoleColor.White, "testhost.exe"),
808808
new TextAndColor(ConsoleColor.Black, " "),
809+
new TextAndColor(ConsoleColor.Black, " "),
809810
new TextAndColor(ConsoleColor.Green, "Command1"),
810811
new TextAndColor(ConsoleColor.Black, " "),
811812
new TextAndColor(ConsoleColor.Cyan, "p1"),
@@ -816,6 +817,7 @@ public void EnsureThatRightParameterIsReportedForGroups()
816817
new TextAndColor(ConsoleColor.Black, " "),
817818
new TextAndColor(ConsoleColor.White, "testhost.exe"),
818819
new TextAndColor(ConsoleColor.Black, " "),
820+
new TextAndColor(ConsoleColor.Black, " "),
819821
new TextAndColor(ConsoleColor.Green, "Command2"),
820822
new TextAndColor(ConsoleColor.Black, " "),
821823
new TextAndColor(ConsoleColor.Cyan, "opt1"),
@@ -846,6 +848,7 @@ public void ErrorWhenNoRequiredParametersInGroupSpecified()
846848
new TextAndColor(ConsoleColor.Black, " "),
847849
new TextAndColor(ConsoleColor.White, "testhost.exe"),
848850
new TextAndColor(ConsoleColor.Black, " "),
851+
new TextAndColor(ConsoleColor.Black, " "),
849852
new TextAndColor(ConsoleColor.Green, "Command1"),
850853
new TextAndColor(ConsoleColor.Black, " "),
851854
new TextAndColor(ConsoleColor.Cyan, "p1"),
@@ -856,6 +859,7 @@ public void ErrorWhenNoRequiredParametersInGroupSpecified()
856859
new TextAndColor(ConsoleColor.Black, " "),
857860
new TextAndColor(ConsoleColor.White, "testhost.exe"),
858861
new TextAndColor(ConsoleColor.Black, " "),
862+
new TextAndColor(ConsoleColor.Black, " "),
859863
new TextAndColor(ConsoleColor.Green, "Command2"),
860864
new TextAndColor(ConsoleColor.Black, " "),
861865
new TextAndColor(ConsoleColor.Cyan, "opt1"),

0 commit comments

Comments
 (0)