Merge pull request #8055 from livarcocc/fix_locale_specific_error

Using OrdinalIgnoreCase when determining arguments
This commit is contained in:
Livar 2017-11-20 12:04:56 -08:00 committed by GitHub
commit 359692601c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,7 +111,7 @@ namespace Microsoft.DotNet.Cli
HelpCommand.PrintHelp(); HelpCommand.PrintHelp();
return 0; return 0;
} }
else if (args[lastArg].StartsWith("-")) else if (args[lastArg].StartsWith("-", StringComparison.OrdinalIgnoreCase))
{ {
Reporter.Error.WriteLine($"Unknown option: {args[lastArg]}"); Reporter.Error.WriteLine($"Unknown option: {args[lastArg]}");
success = false; success = false;
@ -265,7 +265,8 @@ namespace Microsoft.DotNet.Cli
private static bool IsArg(string candidate, string shortName, string longName) private static bool IsArg(string candidate, string shortName, string longName)
{ {
return (shortName != null && candidate.Equals("-" + shortName)) || (longName != null && candidate.Equals("--" + longName)); return (shortName != null && candidate.Equals("-" + shortName, StringComparison.OrdinalIgnoreCase)) ||
(longName != null && candidate.Equals("--" + longName, StringComparison.OrdinalIgnoreCase));
} }
private static string GetDisplayRid(DotnetVersionFile versionFile) private static string GetDisplayRid(DotnetVersionFile versionFile)