Add --askyesremovemake option (#2199)

Same as --askremovemake option but with "Y" as a default answer.
This commit is contained in:
smolx 2023-06-11 18:13:01 +02:00 committed by GitHub
parent 7dc4fae155
commit adde043514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 2 deletions

1
cmd.go
View file

@ -95,6 +95,7 @@ Permanent configuration options:
--nodiffmenu Don't show diffs for build files
--noeditmenu Don't edit/view PKGBUILDS
--askremovemake Ask to remove makedepends after install
--askyesremovemake Ask to remove makedepends after install("Y" as default)
--removemake Remove makedepends after install
--noremovemake Don't remove makedepends after install

View file

@ -75,7 +75,7 @@ _yay() {
noansweredit noanswerupgrade cleanmenu diffmenu editmenu cleanafter nocleanafter
nocleanmenu nodiffmenu provides noprovides pgpfetch nopgpfetch
useask nouseask combinedupgrade nocombinedupgrade aur repo makepkgconf
nomakepkgconf askremovemake removemake noremovemake completioninterval aururl aurrpcurl
nomakepkgconf askremovemake askyesremovemake removemake noremovemake completioninterval aururl aurrpcurl
searchby batchinstall nobatchinstall'
'b d h q r v')
yays=('clean gendb' 'c')

View file

@ -220,6 +220,7 @@ complete -c $progname -n "not $noopt" -l nocleanmenu -d 'Do not clean build PKGB
complete -c $progname -n "not $noopt" -l nodiffmenu -d 'Do not show diffs for build files' -f
complete -c $progname -n "not $noopt" -l noeditmenu -d 'Do not edit/view PKGBUILDS' -f
complete -c $progname -n "not $noopt" -l askremovemake -d 'Ask to remove make deps after install' -f
complete -c $progname -n "not $noopt" -l askyesremovemake -d 'Ask to remove make deps after install(with "Y" as default)' -f
complete -c $progname -n "not $noopt" -l removemake -d 'Remove make deps after install' -f
complete -c $progname -n "not $noopt" -l noremovemake -d 'Do not remove make deps after install' -f
complete -c $progname -n "not $noopt" -l topdown -d 'Shows repository packages first and then aur' -f

View file

@ -74,6 +74,7 @@ _pacman_opts_common=(
"--nodiffmenu[Don't show diffs for build files]"
"--noeditmenu[Don't edit/view PKGBUILDS]"
"--askremovemake[Ask to remove makedepends after install]"
"--askyesremovemake[Ask to remove makedepends after install(with "Y" as default)]"
"--removemake[Remove makedepends after install]"
"--noremovemake[Don't remove makedepends after install]"

View file

@ -326,6 +326,10 @@ Do not show the edit menu.
.B \-\-askremovemake
Ask to remove makedepends after installing packages.
.TP
.B \-\-askyesremovemake
Ask to remove makedepends after installing packages(with "Y" as default).
.TP
.B \-\-removemake
Remove makedepends after installing packages.

View file

@ -199,6 +199,8 @@ func (c *Configuration) handleOption(option, value string) bool {
c.RemoveMake = "no"
case "askremovemake":
c.RemoveMake = "ask"
case "askyesremovemake":
c.RemoveMake = "askyes"
case "separatesources":
c.SeparateSources = true
case "noseparatesources":

View file

@ -440,6 +440,7 @@ func isArg(arg string) bool {
case "removemake":
case "noremovemake":
case "askremovemake":
case "askyesremovemake":
case "complete":
case "stats":
case "news":

View file

@ -115,7 +115,9 @@ func (preper *Preparer) ShouldCleanMakeDeps(cmdArgs *parser.Arguments) PostInsta
case "no":
return nil
default:
if !text.ContinueTask(os.Stdin, gotext.Get("Remove make dependencies after install?"), false, settings.NoConfirm) {
isYesDefault := preper.cfg.RemoveMake == "askyes"
if !text.ContinueTask(os.Stdin, gotext.Get("Remove make dependencies after install?"),
isYesDefault, settings.NoConfirm) {
return nil
}
}