Skip to content

Commit 1081523

Browse files
committed
ignore case
1 parent def830f commit 1081523

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

FluentCommandLineParser.Tests/FluentCommandLineParserTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public void Ensure_Parser_Calls_The_Callback_With_Expected_Enum_When_Using_Short
308308
.Setup<TestEnum>('e')
309309
.Callback(val => actual = val);
310310

311-
parser.Parse(new[] { "-e", expected.ToString() });
311+
parser.Parse(new[] { "-e", expected.ToString().ToLowerInvariant() });
312312

313313
Assert.AreEqual(expected, actual);
314314
}
@@ -326,7 +326,7 @@ public void Ensure_Parser_Calls_The_Callback_With_Expected_Enum_When_Using_Long_
326326
.Setup<TestEnum>("e", "enum")
327327
.Callback(val => actual = val);
328328

329-
parser.Parse(new[] { "--enum", expected.ToString() });
329+
parser.Parse(new[] { "--enum", expected.ToString().ToLowerInvariant() });
330330

331331
Assert.AreEqual(expected, actual);
332332
}

FluentCommandLineParser/Internals/Parsing/OptionParsers/EnumCommandLineOptionParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class EnumCommandLineOptionParser<T> : ICommandLineOptionParser<T>
4444
/// </returns>
4545
public T Parse(ParsedOption parsedOption)
4646
{
47-
return (T)Enum.Parse(typeof(T), parsedOption.Value);
47+
return (T)Enum.Parse(typeof(T), parsedOption.Value, true);
4848
}
4949

5050
/// <summary>

0 commit comments

Comments
 (0)