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

winget should install an app if there is an exact match (eg 'git')

Open mikemaccana opened this issue 6 years ago • 38 comments

Brief description of your issue

C:\Program Files $ winget install Git
Multiple apps found matching input criteria. Please refine the input.
Name                                    Id                                       Version      Matched
---------------------------------------------------------------------------------------------------------
Git                                     Git.Git                                  2.26.2
Logitech Harmony Remote                 Logitech.Harmony                         1.0.1.308
GitHub Desktop                          GitHub.GitHubDesktop                     2.5.0
GitHub CLI                              GitHub.cli                               0.8.0
Atom                                    GitHub.Atom                              1.45.0
AdobeDigitalEditions                    Adobe.AdobeDigitalEditions               4.5.11
MicrosoftGitCredentialManagerforWindows Microsoft.GitCredentialManagerforWindows 1.20.0
Git Large File Storage                  GitHub.GitLFS                            2.11.0
Git Extensions                          GitExtensionsTeam.GitExtensions          3.3.1
MaxTo                                   DigitalCreations.MaxTo                   2.0.1
Gitter IM                               Gitlab.Gitter.IM                         4.1.0
GitKraken                               Axosoft.GitKraken                        7.0.0
TortoiseGit                             TortoiseGit.TortoiseGit                  2.10.0.2
AppInstallerFileBuilder                 Microsoft.AppInstallerFileBuilder        1.2020.211.0 Tag: GitHub
Sublime Merge                           SublimeHQ.SublimeMerge                   1119         Tag: git

Steps to reproduce

winget install Git

Expected behavior

git installs, as the name is an exact match (case insensitive).

Actual behavior

The error above.

Environment

Windows Package Manager v0.1.41331 Preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19628.1
Package: Microsoft.DesktopAppInstaller v1.0.41331.0

Links:
  Privacy Statement: https://aka.ms/winget-privacy
  License agreement: https://aka.ms/winget-license
  3rd Party Notices: https://aka.ms/winget-3rdPartyNotice
  Homepage:          https://aka.ms/winget

mikemaccana avatar May 22 '20 12:05 mikemaccana

I'm having this exact issue with "Powershell" and/or "Microsoft.Powershell", and I have no idea how to actually get the one I want.

CalvinAllen avatar May 22 '20 19:05 CalvinAllen

I've hit the same issue trying to install Discord. IMHO each package should have a mandatory, unique and case insensitive moniker (or just apply those characteristics to the ID). Basically, the same user experience as brew.sh

@CalvinAllen you can use the -e or --exact switch followed by the package name with correct capitalization and perhaps quote marks if it contains a space

kipters avatar May 22 '20 23:05 kipters

@kipters Thanks, that did the trick!

CalvinAllen avatar May 22 '20 23:05 CalvinAllen

I suggest trying -? on the commands. Based on that output, this seems to be expected behavior. Without the -e that kipters mentioned, you are asking it to query for that name.

neville-nazerane avatar May 23 '20 05:05 neville-nazerane

@CalvinAllen you can use the -e or --exact switch followed by the package name with correct capitalization and perhaps quote marks if it contains a space

So we should give user a hint when such things happen. Here is a mock hint. image

KiruyaMomochi avatar May 24 '20 12:05 KiruyaMomochi

@CalvinAllen you can use the -e or --exact switch followed by the package name with correct capitalization and perhaps quote marks if it contains a space

So we should give user a hint when such things happen. Here is a mock hint.

image

This is exactly what happened to me when I discovered the issue

image

kipters avatar May 24 '20 12:05 kipters

This is exactly what happened to me when I discovered the issue

However, it can be difficult for a newbie to find a such a option. That's why I added a hint in the mock screenshot, to make this option more discoverable:

Use -e or --exact option if you want a exact match install.

KiruyaMomochi avatar May 24 '20 12:05 KiruyaMomochi

I support it!

masx200 avatar May 24 '20 12:05 masx200

Im adding onto this because there is tons of pacakges that have Git in the name but i cant possibly install git even with the exact id Git.Git because Git.GitLFS exists.

furtabs avatar May 24 '20 16:05 furtabs

Hints aren't as good as what @kipsters suggested:

IMHO each package should have a mandatory, unique and case insensitive moniker (or just apply those characteristics to the ID).

winget install git should install git. Not tell you to that to type winget install git.git or whatever other obscure command.

There's a reason why most popular package managers have short package names.

mikemaccana avatar May 24 '20 18:05 mikemaccana

"Fall into the pit of success"

Search = case insensitive, non-exact match Install = case insensitive, exact match.

These should be no brainer commands: winget install Git winget install git winget install discord winget install Discord

If I type install, exact match should be inferred. If I wanted a search, I would invoke a search.

CalvinAllen avatar May 24 '20 19:05 CalvinAllen

I ran into this today as well, and it was very confusing. 👍 to changing something here.

steveklabnik avatar May 28 '20 03:05 steveklabnik

I think it is fine that when you say "install git" it says "which git". However, it should show a message similar to what kipters mentioned, or provide a sequence number against the filtered result and ask us to enter a number.

neville-nazerane avatar May 28 '20 05:05 neville-nazerane

I'm having this exact issue with "Powershell" and/or "Microsoft.Powershell", and I have no idea how to actually get the one I want.

We're working with the PowerShell team to address some of this with adjustments to the manifests. For now winget install Microsoft.PowerShell -e works (it is case sensitive).

denelon avatar May 28 '20 23:05 denelon

The Id is intended to be the key to disambiguating between packages. It is currently case sensitive. It also doesn't exclude other Id values that are a superset eg. "Git.Git" and "Git.GitLFS" both match for winget install git.git.

denelon avatar May 28 '20 23:05 denelon

I am also thinking the help dialog may benefit from providing an example. I'll build a short spec.

denelon avatar May 28 '20 23:05 denelon

At the moment, when installing apps with multiple search results, the following nomenclature is working perfectly:

winget install --name <appName> -e

Note that the appName is Case Sensitive !

SubhamK108 avatar Jun 03 '20 13:06 SubhamK108

@SubhamK108 that would work even without the --name

neville-nazerane avatar Jun 04 '20 02:06 neville-nazerane

@neville-nazerane Yes indeed, it's working absolutely fine even without the --name. I didn't test that before.

SubhamK108 avatar Jun 04 '20 03:06 SubhamK108

When I encountered this error I read the documentation and tried using --id and --version to specify the exact package I wanted. It did not work. The -e flag did not jump out to me in the documentation until I found this thread.

winget-confuse

kmuncie avatar Jun 04 '20 12:06 kmuncie