Open denelon opened 2 years ago
Precedence on "Id", "Name", and "Moniker" was selected due to the results of a search query where the "Id" and "Name" are always displayed. The Windows Terminal supports copy/paste shortcuts so those two fields were selected. As the "Id" doesn't contain any spaces, it negates the need to quote the value for command-line operations.
The priority would be "Id" as it is unique to a source, and does not contain spaces. Then the "Name" as it is displayed in search results. Finally, the "Moniker" is often a commonly known term, so if no other package has the requested value for "Id" or "Name", moniker is considered unique enough to disambiguate a requested package.
Note, the flow for matching a package against manifests is used in "Show", "Search", "Install", "Upgrade", and "Uninstall". Of these, "search" is the most permissive looking for substring matches (by default with no options configured) across multiple fields. The other commands use a more refined logic to attempt to find a single best match result to display or act on.
Related to
[Policy] Area-Matching
Description of the new feature / enhancement
When one or more results are returned from all configured sources apply additional logic to help improve client behavior.
Specifically, when a user runs is either the PackageIdentifier, PackageName or Moniker for only one package, that package should be installed.
winget install <query>
and the value inIf more than one package matches in any of the three fields, the user must still disambiguate which result they want installed.
This would impact "install", "show", "upgrade", and "uninstall".
Proposed technical implementation details
No response