mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
Should work on bash. Experimental
This commit is contained in:
parent
e73d75fc37
commit
c2b0958ccb
3 changed files with 10 additions and 5 deletions
|
@ -339,10 +339,13 @@ func Complete() (err error) {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer out.Close()
|
||||
|
||||
aur.CreateAURList(out)
|
||||
if aur.CreateAURList(out) != nil {
|
||||
defer os.Remove(path)
|
||||
}
|
||||
err = pac.CreatePackageList(out)
|
||||
|
||||
out.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ _pacman_pkg() {
|
|||
)"
|
||||
}
|
||||
|
||||
_pacman() {
|
||||
_yay() {
|
||||
local common core cur database prev query remove sync upgrade o
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
@ -90,7 +90,7 @@ _pacman() {
|
|||
_pacman_pkg Qq;;
|
||||
S)
|
||||
{ _arch_incomp 'g groups' && _pacman_pkg Sg; } ||
|
||||
{ _arch_incomp 'l list' && _pacman_pkg Sl sort; } ||
|
||||
{ _arch_incomp 'l list' && $(yay --complete bash); } ||
|
||||
_pacman_pkg Slq;;
|
||||
U)
|
||||
_pacman_file;;
|
||||
|
@ -103,6 +103,6 @@ _pacman_file() {
|
|||
compopt -o filenames; _filedir 'pkg.tar*'
|
||||
}
|
||||
|
||||
complete -F _pacman -o default yay
|
||||
complete -F _yay -o default yay
|
||||
|
||||
# ex:et ts=2 sw=2 ft=sh
|
||||
|
|
|
@ -63,6 +63,8 @@ func parser() (op string, options []string, packages []string, err error) {
|
|||
util.SortMode = util.TopDown
|
||||
case "--complete":
|
||||
util.Shell = os.Args[i+1]
|
||||
fmt.Println(util.Shell)
|
||||
os.Exit(0)
|
||||
yay.Complete()
|
||||
os.Exit(0)
|
||||
case "--help":
|
||||
|
|
Loading…
Reference in a new issue