mirror of
https://github.com/Jguer/yay
synced 2024-10-06 08:09:11 +00:00
feat(search): add optional setting that formats each search result on a single line
This commit is contained in:
parent
f88bf5c212
commit
673f077e7f
2
cmd.go
2
cmd.go
|
@ -119,6 +119,8 @@ Permanent configuration options:
|
||||||
--nocombinedupgrade Perform the repo upgrade and AUR upgrade separately
|
--nocombinedupgrade Perform the repo upgrade and AUR upgrade separately
|
||||||
--batchinstall Build multiple AUR packages then install them together
|
--batchinstall Build multiple AUR packages then install them together
|
||||||
--nobatchinstall Build and install each AUR package one by one
|
--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
|
--sudo <file> sudo command to use
|
||||||
--sudoflags <flags> Pass arguments to sudo
|
--sudoflags <flags> Pass arguments to sudo
|
||||||
|
|
|
@ -76,7 +76,7 @@ _yay() {
|
||||||
nocleanmenu nodiffmenu noupgrademenu provides noprovides pgpfetch nopgpfetch
|
nocleanmenu nodiffmenu noupgrademenu provides noprovides pgpfetch nopgpfetch
|
||||||
useask nouseask combinedupgrade nocombinedupgrade aur repo makepkgconf
|
useask nouseask combinedupgrade nocombinedupgrade aur repo makepkgconf
|
||||||
nomakepkgconf askremovemake removemake noremovemake completioninterval aururl
|
nomakepkgconf askremovemake removemake noremovemake completioninterval aururl
|
||||||
searchby batchinstall nobatchinstall'
|
searchby batchinstall nobatchinstall singlelineresults doublelineresults'
|
||||||
'b d h q r v')
|
'b d h q r v')
|
||||||
yays=('clean gendb' 'c')
|
yays=('clean gendb' 'c')
|
||||||
show=('complete defaultconfig currentconfig stats news' 'c d g s w')
|
show=('complete defaultconfig currentconfig stats news' 'c d g s w')
|
||||||
|
|
|
@ -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 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 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 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 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 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
|
complete -c $progname -n "not $noopt" -l rebuildtree -d 'Always build all AUR packages even if installed' -f
|
||||||
|
|
|
@ -108,6 +108,8 @@ _pacman_opts_common=(
|
||||||
'--sortby[Sort AUR results by a specific field during search]'
|
'--sortby[Sort AUR results by a specific field during search]'
|
||||||
'--batchinstall[Build multiple AUR packages then install them together]'
|
'--batchinstall[Build multiple AUR packages then install them together]'
|
||||||
'--nobatchinstall[Build and install each AUR package one by one]'
|
'--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
|
# options for passing to _arguments: options for --upgrade commands
|
||||||
|
|
10
doc/yay.8
10
doc/yay.8
|
@ -449,6 +449,16 @@ another package, install all the packages in the install queue.
|
||||||
.B \-\-nobatchinstall
|
.B \-\-nobatchinstall
|
||||||
Always install AUR packages immediately after building them.
|
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
|
.TP
|
||||||
.B \-\-rebuild
|
.B \-\-rebuild
|
||||||
Always build target packages even when a copy is available in cache.
|
Always build target packages even when a copy is available in cache.
|
||||||
|
|
|
@ -179,6 +179,10 @@ func (c *Configuration) handleOption(option, value string) bool {
|
||||||
c.RemoveMake = "no"
|
c.RemoveMake = "no"
|
||||||
case "askremovemake":
|
case "askremovemake":
|
||||||
c.RemoveMake = "ask"
|
c.RemoveMake = "ask"
|
||||||
|
case "singlelineresults":
|
||||||
|
c.SingleLineResults = true
|
||||||
|
case "doublelineresults":
|
||||||
|
c.SingleLineResults = false
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ type Configuration struct {
|
||||||
CombinedUpgrade bool `json:"combinedupgrade"`
|
CombinedUpgrade bool `json:"combinedupgrade"`
|
||||||
UseAsk bool `json:"useask"`
|
UseAsk bool `json:"useask"`
|
||||||
BatchInstall bool `json:"batchinstall"`
|
BatchInstall bool `json:"batchinstall"`
|
||||||
|
SingleLineResults bool `json:"singlelineresults"`
|
||||||
Runtime *Runtime `json:"-"`
|
Runtime *Runtime `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -444,6 +444,8 @@ func isArg(arg string) bool {
|
||||||
case "news":
|
case "news":
|
||||||
case "gendb":
|
case "gendb":
|
||||||
case "currentconfig":
|
case "currentconfig":
|
||||||
|
case "singlelineresults":
|
||||||
|
case "doublelineresults":
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue