diff --git a/README.md b/README.md index 1f031da2..248e49b0 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ __This library provides _hassle free_ command line parsing with a constantly upd You can utilize the parser library in several ways: -- Install via Nuget/Paket +- Install via Nuget/Paket: [https://www.nuget.org/packages/CommandLineParser/](https://www.nuget.org/packages/CommandLineParser/) - Integrate directly into your project by copying the .cs files into your project. - ILMerge during your build process. diff --git a/src/CommandLine/Core/InstanceChooser.cs b/src/CommandLine/Core/InstanceChooser.cs index f68216b1..66e0e91c 100644 --- a/src/CommandLine/Core/InstanceChooser.cs +++ b/src/CommandLine/Core/InstanceChooser.cs @@ -17,6 +17,7 @@ public static ParserResult Choose( IEnumerable types, IEnumerable arguments, StringComparer nameComparer, + bool ignoreValueCase, CultureInfo parsingCulture, IEnumerable nonFatalErrors) { @@ -36,7 +37,7 @@ public static ParserResult Choose( arguments.Skip(1).FirstOrDefault() ?? string.Empty, nameComparer)) : preprocCompare("version") ? MakeNotParsed(types, new VersionRequestedError()) - : MatchVerb(tokenizer, verbs, arguments, nameComparer, parsingCulture, nonFatalErrors); + : MatchVerb(tokenizer, verbs, arguments, nameComparer, ignoreValueCase, parsingCulture, nonFatalErrors); }; return arguments.Any() @@ -49,6 +50,7 @@ private static ParserResult MatchVerb( IEnumerable> verbs, IEnumerable arguments, StringComparer nameComparer, + bool ignoreValueCase, CultureInfo parsingCulture, IEnumerable nonFatalErrors) { @@ -60,7 +62,7 @@ private static ParserResult MatchVerb( tokenizer, arguments.Skip(1), nameComparer, - false, + ignoreValueCase, parsingCulture, nonFatalErrors) : MakeNotParsed(verbs.Select(v => v.Item2), new BadVerbSelectedError(arguments.First())); diff --git a/src/CommandLine/Parser.cs b/src/CommandLine/Parser.cs index a1c5cbdf..1856e6c7 100644 --- a/src/CommandLine/Parser.cs +++ b/src/CommandLine/Parser.cs @@ -156,6 +156,7 @@ public ParserResult ParseArguments(IEnumerable args, params Type types, args, settings.NameComparer, + settings.CaseInsensitiveEnumValues, settings.ParsingCulture, HandleUnknownArguments(settings.IgnoreUnknownArguments)), settings); diff --git a/src/CommandLine/ParserResult.cs b/src/CommandLine/ParserResult.cs index 5ec4c073..20761ada 100644 --- a/src/CommandLine/ParserResult.cs +++ b/src/CommandLine/ParserResult.cs @@ -6,7 +6,7 @@ namespace CommandLine { - sealed class TypeInfo + public sealed class TypeInfo { private readonly Type current; private readonly IEnumerable choices; @@ -27,12 +27,12 @@ public IEnumerable Choices get { return this.choices; } } - public static TypeInfo Create(Type current) + internal static TypeInfo Create(Type current) { return new TypeInfo(current, Enumerable.Empty()); } - public static TypeInfo Create(Type current, IEnumerable choices) + internal static TypeInfo Create(Type current, IEnumerable choices) { return new TypeInfo(current, choices); } @@ -78,7 +78,7 @@ public ParserResultType Tag get { return this.tag; } } - internal TypeInfo TypeInfo + public TypeInfo TypeInfo { get { return typeInfo; } } @@ -216,4 +216,4 @@ public bool Equals(NotParsed other) && Errors.SequenceEqual(other.Errors); } } -} \ No newline at end of file +} diff --git a/src/CommandLine/Text/HeadingInfo.cs b/src/CommandLine/Text/HeadingInfo.cs index 286a1872..c8544546 100644 --- a/src/CommandLine/Text/HeadingInfo.cs +++ b/src/CommandLine/Text/HeadingInfo.cs @@ -57,7 +57,7 @@ public static HeadingInfo Default { var title = ReflectionHelper.GetAttribute() .MapValueOrDefault( - titleAttribute => Path.GetFileNameWithoutExtension(titleAttribute.Title), + titleAttribute => titleAttribute.Title, ReflectionHelper.GetAssemblyName()); var version = ReflectionHelper.GetAttribute() .MapValueOrDefault( diff --git a/tests/CommandLine.Tests/Unit/Core/InstanceChooserTests.cs b/tests/CommandLine.Tests/Unit/Core/InstanceChooserTests.cs index 96d175b1..29b0394b 100644 --- a/tests/CommandLine.Tests/Unit/Core/InstanceChooserTests.cs +++ b/tests/CommandLine.Tests/Unit/Core/InstanceChooserTests.cs @@ -22,6 +22,7 @@ private static ParserResult InvokeChoose( types, arguments, StringComparer.Ordinal, + false, CultureInfo.InvariantCulture, Enumerable.Empty()); }