winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Enumerate packages when multiple found by 'winget install xxxx'

Open nWestie opened this issue 3 years ago • 2 comments

Description of the new feature / enhancement

Currently, when winget finds multiple matching packages for the name provided, it lists them and exits. Instead, it would be useful if, when the number of options is small(perhaps <10 or a screen full), it enumerates the options and allowes the user to enter a number, then installs that. Currently, I must type out the full identifier or grab my mouse to copy and paste. Yes, this is not that much of a nuisance, but I think my suggestion is also similarly simple.

Current Layout

PS C:\Users\westn> winget install git
Multiple packages found matching input criteria. Please refine the input.
Name   Id           Source
---------------------------
My Git 9NLVK2SL2SSP msstore
Git    Git.Git      winget

Suggested Layout

PS C:\Users\westn> winget install git
Multiple packages found matching input criteria. Please refine the input.
Name   Id           Source
---------------------------
1) My Git 9NLVK2SL2SSP msstore
2) Git    Git.Git      winget
Select a package to continue: 

Proposed technical implementation details

This seems fairly straight forward technically. If >1 but <10 packages are found when winget install xx is called, it numbers the options down the left side, and prompts the user to pick one. The user enters a number, and install continues. This should only happen when installing a single package, not when installing from a import file.

nWestie avatar Jun 21 '23 23:06 nWestie

Duplicate of #419

Trenly avatar Jun 22 '23 01:06 Trenly

Hello @nWestie,

We've identified this as a duplicate of another issue or PR that already exists. This specific instance is being closed in favor of the linked issue. Please add your 👍 to the other issue to raise its priority. Thanks for your contribution!

Template: msftbot/duplicate/closed