Skip to content

Commit dc3011c

Browse files
tdashworthjonsequitur
authored andcommitted
Move | replacement to IsMatch method
1 parent ff94031 commit dc3011c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/System.CommandLine/Binding/Binder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ internal static class Binder
99
{
1010
internal static bool IsMatch(this string parameterName, string alias) =>
1111
string.Equals(alias?.RemovePrefix()
12-
.Replace("-", ""),
12+
.Replace("-", "")
13+
.Replace("|", "or"),
1314
parameterName,
1415
StringComparison.OrdinalIgnoreCase);
1516

src/System.CommandLine/Parsing/CommandResultExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal static bool TryGetValueForArgument(
3636
{
3737
foreach (var argument in commandResult.Command.Arguments)
3838
{
39-
if (valueName.IsMatch(argument.Name) || valueName.IsMatch(argument.Name.Replace("|","or")))
39+
if (valueName.IsMatch(argument.Name))
4040
{
4141
value = commandResult.ArgumentConversionResults[argument.Name]?.GetValueOrDefault();
4242
return true;

0 commit comments

Comments
 (0)