Kaynağa Gözat

Add --askyesremovemake option (#2199)

Same as --askremovemake option but with "Y" as a default answer.
smolx 1 yıl önce
ebeveyn
işleme
adde043514
8 değiştirilmiş dosya ile 14 ekleme ve 2 silme
  1. 1 0
      cmd.go
  2. 1 1
      completions/bash
  3. 1 0
      completions/fish
  4. 1 0
      completions/zsh
  5. 4 0
      doc/yay.8
  6. 2 0
      pkg/settings/args.go
  7. 1 0
      pkg/settings/parser/parser.go
  8. 3 1
      preparer.go

+ 1 - 0
cmd.go

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

+ 1 - 1
completions/bash

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

+ 1 - 0
completions/fish

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

+ 1 - 0
completions/zsh

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

+ 4 - 0
doc/yay.8

@@ -327,6 +327,10 @@ Do not show the edit menu.
 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.
 

+ 2 - 0
pkg/settings/args.go

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

+ 1 - 0
pkg/settings/parser/parser.go

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

+ 3 - 1
preparer.go

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