Merge pull request #8055 from livarcocc/fix_locale_specific_error
Using OrdinalIgnoreCase when determining arguments
This commit is contained in:
commit
359692601c
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue