diff --git a/cmd.go b/cmd.go index ef80467..7d94df7 100644 --- a/cmd.go +++ b/cmd.go @@ -119,6 +119,8 @@ Permanent configuration options: --nocombinedupgrade Perform the repo upgrade and AUR upgrade separately --batchinstall Build multiple AUR packages then install them together --nobatchinstall Build and install each AUR package one by one + --singlelineresults List each search result on its own line + --doublelineresults List each search result on two lines, like pacman --sudo sudo command to use --sudoflags Pass arguments to sudo diff --git a/completions/bash b/completions/bash index ee41e4f..ba84fc3 100644 --- a/completions/bash +++ b/completions/bash @@ -76,7 +76,7 @@ _yay() { nocleanmenu nodiffmenu noupgrademenu provides noprovides pgpfetch nopgpfetch useask nouseask combinedupgrade nocombinedupgrade aur repo makepkgconf nomakepkgconf askremovemake removemake noremovemake completioninterval aururl - searchby batchinstall nobatchinstall' + searchby batchinstall nobatchinstall singlelineresults doublelineresults' 'b d h q r v') yays=('clean gendb' 'c') show=('complete defaultconfig currentconfig stats news' 'c d g s w') diff --git a/completions/fish b/completions/fish index f22df83..17d1451 100644 --- a/completions/fish +++ b/completions/fish @@ -237,6 +237,8 @@ complete -c $progname -n "not $noopt" -l combinedupgrade -d 'Refresh then perfor complete -c $progname -n "not $noopt" -l nocombinedupgrade -d 'Perform the repo upgrade and AUR upgrade separately' -f complete -c $progname -n "not $noopt" -l batchinstall -d 'Build multiple AUR packages then install them together' -f complete -c $progname -n "not $noopt" -l nobatchinstall -d 'Build and install each AUR package one by one' -f +complete -c $progname -n "not $noopt" -l singlelineresults -d 'List each search result on its own line' -f +complete -c $progname -n "not $noopt" -l doublelineresults -d 'List each search result on two lines, like pacman' -f complete -c $progname -n "not $noopt" -l rebuild -d 'Always build target packages' -f complete -c $progname -n "not $noopt" -l rebuildall -d 'Always build all AUR packages' -f complete -c $progname -n "not $noopt" -l rebuildtree -d 'Always build all AUR packages even if installed' -f diff --git a/completions/zsh b/completions/zsh index 6b9567d..bb8addd 100644 --- a/completions/zsh +++ b/completions/zsh @@ -108,6 +108,8 @@ _pacman_opts_common=( '--sortby[Sort AUR results by a specific field during search]' '--batchinstall[Build multiple AUR packages then install them together]' '--nobatchinstall[Build and install each AUR package one by one]' + '--singlelineresults[List each search result on its own line]' + '--doublelineresults[List each search result on two lines, like pacman]' ) # options for passing to _arguments: options for --upgrade commands diff --git a/doc/yay.8 b/doc/yay.8 index de7fdef..ecc942a 100644 --- a/doc/yay.8 +++ b/doc/yay.8 @@ -449,6 +449,16 @@ another package, install all the packages in the install queue. .B \-\-nobatchinstall Always install AUR packages immediately after building them. +.TP +.B \-\-singlelineresults +Override pacman's usual double-line search result format and list each result +on its own line. + +.TP +.B \-\-doublelineresults +Follow pacman's double-line search result format and list each result using +two lines. + .TP .B \-\-rebuild Always build target packages even when a copy is available in cache. diff --git a/pkg/settings/args.go b/pkg/settings/args.go index a16f8e9..de64134 100644 --- a/pkg/settings/args.go +++ b/pkg/settings/args.go @@ -179,6 +179,10 @@ func (c *Configuration) handleOption(option, value string) bool { c.RemoveMake = "no" case "askremovemake": c.RemoveMake = "ask" + case "singlelineresults": + c.SingleLineResults = true + case "doublelineresults": + c.SingleLineResults = false default: return false } diff --git a/pkg/settings/config.go b/pkg/settings/config.go index c9dcac5..e7c5f1b 100644 --- a/pkg/settings/config.go +++ b/pkg/settings/config.go @@ -75,6 +75,7 @@ type Configuration struct { CombinedUpgrade bool `json:"combinedupgrade"` UseAsk bool `json:"useask"` BatchInstall bool `json:"batchinstall"` + SingleLineResults bool `json:"singlelineresults"` Runtime *Runtime `json:"-"` } diff --git a/pkg/settings/parser/parser.go b/pkg/settings/parser/parser.go index 04f5ce5..55f5520 100644 --- a/pkg/settings/parser/parser.go +++ b/pkg/settings/parser/parser.go @@ -444,6 +444,8 @@ func isArg(arg string) bool { case "news": case "gendb": case "currentconfig": + case "singlelineresults": + case "doublelineresults": default: return false }