Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #197 #344

Merged
merged 8 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 4 additions & 2 deletions src/CommandLine/Core/InstanceChooser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static ParserResult<object> Choose(
IEnumerable<Type> types,
IEnumerable<string> arguments,
StringComparer nameComparer,
bool ignoreValueCase,
CultureInfo parsingCulture,
IEnumerable<ErrorType> nonFatalErrors)
{
Expand All @@ -36,7 +37,7 @@ public static ParserResult<object> 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()
Expand All @@ -49,6 +50,7 @@ private static ParserResult<object> MatchVerb(
IEnumerable<Tuple<Verb, Type>> verbs,
IEnumerable<string> arguments,
StringComparer nameComparer,
bool ignoreValueCase,
CultureInfo parsingCulture,
IEnumerable<ErrorType> nonFatalErrors)
{
Expand All @@ -60,7 +62,7 @@ private static ParserResult<object> MatchVerb(
tokenizer,
arguments.Skip(1),
nameComparer,
false,
ignoreValueCase,
parsingCulture,
nonFatalErrors)
: MakeNotParsed(verbs.Select(v => v.Item2), new BadVerbSelectedError(arguments.First()));
Expand Down
1 change: 1 addition & 0 deletions src/CommandLine/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public ParserResult<object> ParseArguments(IEnumerable<string> args, params Type
types,
args,
settings.NameComparer,
settings.CaseInsensitiveEnumValues,
settings.ParsingCulture,
HandleUnknownArguments(settings.IgnoreUnknownArguments)),
settings);
Expand Down
10 changes: 5 additions & 5 deletions src/CommandLine/ParserResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace CommandLine
{
sealed class TypeInfo
public sealed class TypeInfo
{
private readonly Type current;
private readonly IEnumerable<Type> choices;
Expand All @@ -27,12 +27,12 @@ public IEnumerable<Type> Choices
get { return this.choices; }
}

public static TypeInfo Create(Type current)
internal static TypeInfo Create(Type current)
{
return new TypeInfo(current, Enumerable.Empty<Type>());
}

public static TypeInfo Create(Type current, IEnumerable<Type> choices)
internal static TypeInfo Create(Type current, IEnumerable<Type> choices)
{
return new TypeInfo(current, choices);
}
Expand Down Expand Up @@ -78,7 +78,7 @@ public ParserResultType Tag
get { return this.tag; }
}

internal TypeInfo TypeInfo
public TypeInfo TypeInfo
{
get { return typeInfo; }
}
Expand Down Expand Up @@ -216,4 +216,4 @@ public bool Equals(NotParsed<T> other)
&& Errors.SequenceEqual(other.Errors);
}
}
}
}
2 changes: 1 addition & 1 deletion src/CommandLine/Text/HeadingInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static HeadingInfo Default
{
var title = ReflectionHelper.GetAttribute<AssemblyTitleAttribute>()
.MapValueOrDefault(
titleAttribute => Path.GetFileNameWithoutExtension(titleAttribute.Title),
titleAttribute => titleAttribute.Title,
ReflectionHelper.GetAssemblyName());
var version = ReflectionHelper.GetAttribute<AssemblyInformationalVersionAttribute>()
.MapValueOrDefault(
Expand Down
1 change: 1 addition & 0 deletions tests/CommandLine.Tests/Unit/Core/InstanceChooserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ private static ParserResult<object> InvokeChoose(
types,
arguments,
StringComparer.Ordinal,
false,
CultureInfo.InvariantCulture,
Enumerable.Empty<ErrorType>());
}
Expand Down