Skip to content

Commit 8ec50ae

Browse files
committed
ordinal case insensitive sorting for suggestions
1 parent a325d88 commit 8ec50ae

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/System.CommandLine.Suggest.Tests/DotnetSuggestEndToEndTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ await Process.ExecuteAsync(
155155

156156
stdOut.ToString()
157157
.Should()
158-
.Be($"/?{NewLine}/h{NewLine}-?{NewLine}--apple{NewLine}--banana{NewLine}--cherry{NewLine}--durian{NewLine}-h{NewLine}--help{NewLine}--version{NewLine}");
158+
.Be($"--apple{NewLine}--banana{NewLine}--cherry{NewLine}--durian{NewLine}--help{NewLine}--version{NewLine}-?{NewLine}-h{NewLine}/?{NewLine}/h{NewLine}");
159159
}
160160
}
161161
}

src/System.CommandLine/Argument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public override IEnumerable<string> GetSuggestions(string textToMatch = null)
192192
.Concat(dynamicSuggestions)
193193
.Concat(typeSuggestions)
194194
.Distinct()
195-
.OrderBy(c => c)
195+
.OrderBy(c => c, StringComparer.OrdinalIgnoreCase)
196196
.Containing(textToMatch);
197197
}
198198

src/System.CommandLine/Symbol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public virtual IEnumerable<string> GetSuggestions(string textToMatch = null)
146146
return this.ChildSymbolAliases()
147147
.Concat(argumentSuggestions)
148148
.Distinct()
149-
.OrderBy(symbol => symbol)
149+
.OrderBy(symbol => symbol, StringComparer.OrdinalIgnoreCase)
150150
.Containing(textToMatch);
151151
}
152152

0 commit comments

Comments
 (0)