mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
Support answerdiff to match answer{clean,edit}
This commit is contained in:
parent
0960f9a135
commit
01fa34093f
4 changed files with 22 additions and 8 deletions
4
cmd.go
4
cmd.go
|
@ -262,6 +262,10 @@ func handleConfig(option, value string) bool {
|
||||||
config.AnswerClean = value
|
config.AnswerClean = value
|
||||||
case "noanswerclean":
|
case "noanswerclean":
|
||||||
config.AnswerClean = ""
|
config.AnswerClean = ""
|
||||||
|
case "answerdiff":
|
||||||
|
config.AnswerDiff = value
|
||||||
|
case "noanswerdiff":
|
||||||
|
config.AnswerDiff = ""
|
||||||
case "answeredit":
|
case "answeredit":
|
||||||
config.AnswerEdit = value
|
config.AnswerEdit = value
|
||||||
case "noansweredit":
|
case "noansweredit":
|
||||||
|
|
|
@ -45,6 +45,7 @@ type Configuration struct {
|
||||||
ReDownload string `json:"redownload"`
|
ReDownload string `json:"redownload"`
|
||||||
ReBuild string `json:"rebuild"`
|
ReBuild string `json:"rebuild"`
|
||||||
AnswerClean string `json:"answerclean"`
|
AnswerClean string `json:"answerclean"`
|
||||||
|
AnswerDiff string `json:"answerdiff"`
|
||||||
AnswerEdit string `json:"answeredit"`
|
AnswerEdit string `json:"answeredit"`
|
||||||
AnswerUpgrade string `json:"answerupgrade"`
|
AnswerUpgrade string `json:"answerupgrade"`
|
||||||
GitBin string `json:"gitbin"`
|
GitBin string `json:"gitbin"`
|
||||||
|
@ -167,6 +168,7 @@ func defaultSettings(config *Configuration) {
|
||||||
config.ReDownload = "no"
|
config.ReDownload = "no"
|
||||||
config.ReBuild = "no"
|
config.ReBuild = "no"
|
||||||
config.AnswerClean = ""
|
config.AnswerClean = ""
|
||||||
|
config.AnswerDiff = ""
|
||||||
config.AnswerEdit = ""
|
config.AnswerEdit = ""
|
||||||
config.AnswerUpgrade = ""
|
config.AnswerUpgrade = ""
|
||||||
config.GitClone = true
|
config.GitClone = true
|
||||||
|
|
22
install.go
22
install.go
|
@ -477,19 +477,25 @@ func diffNumberMenu(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, installed stri
|
||||||
|
|
||||||
func editDiffNumberMenu(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, installed stringSet, diff bool) ([]*rpc.Pkg, error) {
|
func editDiffNumberMenu(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, installed stringSet, diff bool) ([]*rpc.Pkg, error) {
|
||||||
toEdit := make([]*rpc.Pkg, 0)
|
toEdit := make([]*rpc.Pkg, 0)
|
||||||
|
var editInput string
|
||||||
|
var err error
|
||||||
|
|
||||||
|
fmt.Println(bold(green(arrow) + cyan(" [N]one ") + "[A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"))
|
||||||
|
|
||||||
if diff {
|
if diff {
|
||||||
fmt.Println(bold(green(arrow + " Diffs to show?")))
|
fmt.Println(bold(green(arrow + " Diffs to show?")))
|
||||||
|
fmt.Print(bold(green(arrow + " ")))
|
||||||
|
editInput, err = getInput(config.AnswerDiff)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.Println(bold(green(arrow + " PKGBUILDs to edit?")))
|
fmt.Println(bold(green(arrow + " PKGBUILDs to edit?")))
|
||||||
}
|
fmt.Print(bold(green(arrow + " ")))
|
||||||
fmt.Println(bold(green(arrow) + cyan(" [N]one ") + "[A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"))
|
editInput, err = getInput(config.AnswerEdit)
|
||||||
|
if err != nil {
|
||||||
fmt.Print(bold(green(arrow + " ")))
|
return nil, err
|
||||||
|
}
|
||||||
editInput, err := getInput(config.AnswerEdit)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
eInclude, eExclude, eOtherInclude, eOtherExclude := parseNumberMenu(editInput)
|
eInclude, eExclude, eOtherInclude, eOtherExclude := parseNumberMenu(editInput)
|
||||||
|
|
|
@ -469,6 +469,8 @@ func hasParam(arg string) bool {
|
||||||
return true
|
return true
|
||||||
case "answerclean":
|
case "answerclean":
|
||||||
return true
|
return true
|
||||||
|
case "answerdiff":
|
||||||
|
return true
|
||||||
case "answeredit":
|
case "answeredit":
|
||||||
return true
|
return true
|
||||||
case "answerupgrade":
|
case "answerupgrade":
|
||||||
|
|
Loading…
Reference in a new issue