Change show and install to use a narrower search#492
Merged
JohnMcPMS merged 7 commits intomicrosoft:masterfrom Jul 14, 2020
Merged
Change show and install to use a narrower search#492JohnMcPMS merged 7 commits intomicrosoft:masterfrom
JohnMcPMS merged 7 commits intomicrosoft:masterfrom
Conversation
yao-msft
reviewed
Jul 13, 2020
| } | ||
|
|
||
| if (args.Contains(Execution::Args::Type::Name)) | ||
| { |
Contributor
There was a problem hiding this comment.
Shall we move the same logic to a common method? Or you expect them to divert in the future?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #292
Change
This changes show and install to use case insensitive equality on id, name or moniker as the default query behavior. So
winget show gitnow returnsGit.Gitas it matches on both name and moniker. The filters can still be used to target specific fields, but they too will require case insensitive equality rather than substring. The best way to target a specific package will be to use--id, as the commandwinget install --id foo.barshould now always find the packagefoo.bar, or nothing. (For reference, show and install use the same algorithm to find the package to operate on.)As part of implementing this change, a case insensitive match level was added to the search functionality. This will sort case insensitive matches higher than substring matches in search results. So in the above example,
winget search gitputsGit.Gitat the top of the search results now. This also means that if the search query is usable as an install query, the packages that would be found will also be at the top.Finally, a few more strings were moved to localized resources and many instances of
applicationwere changed topackagefor consistency with the overall name and future considerations regarding non-application packages (such as fonts).Thanks to @thlac for his proposal in #283 that spurred the discussion to change these. If someone knows how to give him co-author credit I would be happy to.
Validation
Added tests for case insensitive match level, as well as for the new search for single package functionality.
Microsoft Reviewers: Open in CodeFlow