Jguer / yay

Yet another Yogurt - An AUR Helper written in Go
GNU General Public License v3.0
10.89k stars 355 forks source link

Querying for information attempts to install packages #2294

Open rustysys-dev opened 11 months ago

rustysys-dev commented 11 months ago

Affected Version

I also upgraded my version from whatever it was before it was affected on that version too (didn't look)

 yay -V                                       ✔  7s  
yay v12.1.3 - libalpm v13.0.2

Describe the bug

On Manjaro Linux (sway), yay --info <package> tries to install or reinstall the package

Reproduction Steps

  1. yay --info

Expected behavior

Querying info gives me info about the package, not attempts to install it.

Output

{
        "aururl": "https://aur.archlinux.org",
        "aurrpcurl": "https://aur.archlinux.org/rpc?",
        "buildDir": "/home/rusty/.cache/yay",
        "editor": "",
        "editorflags": "",
        "makepkgbin": "makepkg",
        "makepkgconf": "",
        "pacmanbin": "pacman",
        "pacmanconf": "/etc/pacman.conf",
        "redownload": "no",
        "answerclean": "",
        "answerdiff": "",
        "answeredit": "",
        "answerupgrade": "",
        "gitbin": "git",
        "gpgbin": "gpg",
        "gpgflags": "",
        "mflags": "",
        "sortby": "votes",
        "searchby": "name-desc",
        "gitflags": "",
        "removemake": "ask",
        "sudobin": "sudo",
        "sudoflags": "",
        "version": "12.1.3",
        "requestsplitn": 150,
        "completionrefreshtime": 7,
        "maxconcurrentdownloads": 0,
        "bottomup": true,
        "sudoloop": false,
        "timeupdate": false,
        "devel": false,
        "cleanAfter": false,
        "provides": true,
        "pgpfetch": true,
        "cleanmenu": true,
        "diffmenu": true,
        "editmenu": false,
        "combinedupgrade": true,
        "useask": false,
        "batchinstall": false,
        "singlelineresults": false,
        "separatesources": true,
        "debug": false,
        "rpc": true,
        "doubleconfirm": true,
        "rebuild": "no"
}
 yay --debug --info yay                              ✔ 
[DEBUG:runtime] rpc request https://aur.archlinux.org/rpc?arg=yay&by=name-desc&type=search&v=5
[DEBUG:runtime] packages to query [aptyay-git ffpb parui-git perl-reply pikaur pikaur-aurnews pikaur-git pkm yay yay-bin yay-git yaycache yayfzf]
[DEBUG:runtime] rpc request https://aur.archlinux.org/rpc?arg%5B%5D=aptyay-git&arg%5B%5D=ffpb&arg%5B%5D=parui-git&arg%5B%5D=perl-reply&arg%5B%5D=pikaur&arg%5B%5D=pikaur-aurnews&arg%5B%5D=pikaur-git&arg%5B%5D=pkm&arg%5B%5D=yay&arg%5B%5D=yay-bin&arg%5B%5D=yay-git&arg%5B%5D=yaycache&arg%5B%5D=yayfzf&type=info&v=5
15 aur/perl-reply 0.42-3 (+0 0.00) 
    read, eval, print, loop, yay!
14 aur/pkm 1.2.1-1 (+1 0.00) 
    A simple wrapper for yay
13 aur/pikaur-aurnews 1.18.3-1 (+2 0.00) 
    AUR helper which asks all questions before installing/building. Inspired by pacaur, yaourt and yay, and with the live aurnews eggzpatch
12 aur/aptyay-git r2.42785d0-1 (+2 0.00) 
    Changes yay syntax to be more like APT
11 aur/ffpb 0.4.1-1 (+7 0.29) 
    A progress bar for ffmpeg. Yay !
10 aur/parui-git 1.0.11.r0.63af503-2 (+8 0.12) 
    Simple TUI frontend for paru or yay.
9 aur/pikaur-git 1.18.3-1 (+27 0.33) 
    AUR helper which asks all questions before installing/building. Inspired by pacaur, yaourt and yay.
8 aur/yaycache 0.1.0-1 (+0 0.00) 
    Flexible yay cache cleaning
7 aur/pikaur 1.18.3-1 (+266 1.59) 
    AUR helper which asks all questions before installing/building. Inspired by pacaur, yaourt and yay.
6 aur/yayfzf 1.0.2-0 (+3 0.03) 
    AUR package fzf finder to search, install, remove, and manage packages using yay
5 aur/yay-git 12.1.3.r0.ge60ccdf-1 (+47 0.75) 
    Yet another yogurt. Pacman wrapper and AUR helper written in go. (development version)
4 aur/yay-bin 12.1.3-1 (+247 6.15) 
    Yet another yogurt. Pacman wrapper and AUR helper written in go. Pre-compiled.
3 extra/ruby-yard 0.9.28-2 (1.0 MiB 4.6 MiB) 
    YARD is a Ruby Documentation tool. The Y stands for "Yay!"
2 extra/yay 12.1.3-1 (3.6 MiB 9.1 MiB) (Installed)
    Yet another yogurt. Pacman wrapper and AUR helper written in go.
1 aur/yay 12.1.3-1 (+2032 28.24) (Installed)
    Yet another yogurt. Pacman wrapper and AUR helper written in go.
==> Packages to install (eg: 1 2 3, 1-3 or ^4)
==> no
 there is nothing to do
rustysys-dev commented 11 months ago

I see what the issue is now... the user experience for this is... maybe a bit difficult...

The reason for this is due to how the help documentation is displayed. Since every option is displayed right away we can't see the context for which an option is valid.

does it make sense to use..

yay -Q --info yay

yes, but does it make sense to use

yay -Q --cleanafter yay

not so much... and yet, auto complete allows this, and so does it show options at the top level as well. So much so that it make s the following appear to be valid for a usecase but will not work as the user might expect

yay --info yay

It might be good to organise the the command structure documentation a bit better, or to start making alias of certain parts that are more confusing... that being said now that I better understand the scope of this issue It would be better to close this and open a new one as a feature request (also taking into account that this new understanding might be already documented as an enhancement in another issue... I will need to look)