-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change show and install to use a narrower search #492
Merged
Merged
Conversation
This file contains 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
yao-msft
reviewed
Jul 13, 2020
} | ||
|
||
if (args.Contains(Execution::Args::Type::Name)) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we move the same logic to a common method? Or you expect them to divert in the future?
yao-msft
approved these changes
Jul 13, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 git
now returnsGit.Git
as 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.bar
should 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 git
putsGit.Git
at 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
application
were changed topackage
for 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