1
0
mirror of https://github.com/Jguer/yay synced 2024-07-05 09:50:44 +00:00

feat(search): add optional setting that formats each search result on a single line

This commit is contained in:
Matt Alexander 2021-10-29 15:59:06 -05:00 committed by J Guerreiro
parent f88bf5c212
commit 673f077e7f
8 changed files with 24 additions and 1 deletions

2
cmd.go
View File

@ -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 <file> sudo command to use
--sudoflags <flags> Pass arguments to sudo

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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
}

View File

@ -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:"-"`
}

View File

@ -444,6 +444,8 @@ func isArg(arg string) bool {
case "news":
case "gendb":
case "currentconfig":
case "singlelineresults":
case "doublelineresults":
default:
return false
}