diff --git a/cmd/yay/yay.go b/cmd/yay/yay.go index 340189de..9068cd37 100644 --- a/cmd/yay/yay.go +++ b/cmd/yay/yay.go @@ -27,9 +27,9 @@ func usage() { yay -G [package(s)] get pkgbuild from ABS or AUR New options: - --topdown shows repository's packages first and then aur's - --bottomup shows aur's packages first and then repository's - --noconfirm skip user input on package install + --topdown shows repository's packages first and then aur's + --bottomup shows aur's packages first and then repository's + --noconfirm skip user input on package install `) } diff --git a/zsh-completion b/zsh-completion index e1d2ea76..ab1f6b28 100644 --- a/zsh-completion +++ b/zsh-completion @@ -1,4 +1,4 @@ -#compdef pacman pacman.static=pacman pacman-key makepkg +#compdef yay yay.static=yay typeset -A opt_args setopt extendedglob @@ -6,6 +6,7 @@ setopt extendedglob # options for passing to _arguments: main pacman commands _pacman_opts_commands=( {-D,--database}'[Modify database]' + {-G,--getpkgfile}'[Get PKGBUILD from ABS or AUR]' {-Q,--query}'[Query the package database]' {-R,--remove}'[Remove a package from the system]' {-S,--sync}'[Synchronize packages]' @@ -22,6 +23,8 @@ _pacman_opts_common=( {-h,--help}'[Display syntax for the given operation]' {-r,--root}'[Set alternate installation root]:installation root:_files -/' {-v,--verbose}'[Be more verbose]' + '--topdown[shows repositorys packages first and then aurs]' + '--bottomup[shows aurs packages first and then repositorys]' '--cachedir[Alternate package cache location]:cache_location:_files -/' '--config[An alternate configuration file]:config file:_files' '--logfile[An alternate log file]:config file:_files' @@ -263,7 +266,7 @@ _pacman_completions_all_packages() { typeset -U packages _wanted packages expl "packages" compadd - "${(@)packages}" - repositories=(${(o)${${${(M)${(f)"$(<@sysconfdir@/pacman.conf)"}:#\[*}/\[/}/\]/}:#options}) + repositories=(${(o)${${${(M)${(f)"$(/dev/null | awk ' - $1 == "pub" { - # key id - split($2, a, "/"); print a[2] - } - $1 == "uid" { - # email - if (match($NF, /<[^>]+>/)) - print substr($NF, RSTART + 1, RLENGTH - 2) - #this adds support for names as well if that is ever added - } - $1 == "uid" { - for (i=2;i