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 #207: Additional command names are case-sensitive #210

Merged
merged 1 commit into from
Feb 5, 2019

Conversation

jcaillon
Copy link
Contributor

Hello,

This PR fixes issue #207. I can modify it if needed.

Best regards

@@ -29,7 +29,7 @@ public partial class CommandLineApplication : IServiceProvider, IDisposable
private List<Action<ParseResult>> _onParsingComplete;
internal readonly Dictionary<string, PropertyInfo> _shortOptions = new Dictionary<string, PropertyInfo>();
internal readonly Dictionary<string, PropertyInfo> _longOptions = new Dictionary<string, PropertyInfo>();
private readonly HashSet<string> _names = new HashSet<string>(StringComparer.Ordinal);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than add a new API, I think I would rather just keep the code as is, but change this to StringComparer.OrdinalIgnoreCase. This was a new feature in 2.3 which hasn't seen much usage yet. Now that I think about it, I doubt many users would want subcommands to vary by case, and in 2.2 subcommand name matching was already case-insensitive.

@natemcmaster
Copy link
Owner

Thanks for making the PR. If you can update with my suggestion and make sure the tests are passing, I'll be happy to get this into a patch soon.

Thanks,
Nate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants