mirror of
https://github.com/Jguer/yay
synced 2024-08-31 05:39:29 +00:00
Support answerdiff to match answer{clean,edit}
This commit is contained in:
parent
0960f9a135
commit
01fa34093f
4
cmd.go
4
cmd.go
|
@ -262,6 +262,10 @@ func handleConfig(option, value string) bool {
|
|||
config.AnswerClean = value
|
||||
case "noanswerclean":
|
||||
config.AnswerClean = ""
|
||||
case "answerdiff":
|
||||
config.AnswerDiff = value
|
||||
case "noanswerdiff":
|
||||
config.AnswerDiff = ""
|
||||
case "answeredit":
|
||||
config.AnswerEdit = value
|
||||
case "noansweredit":
|
||||
|
|
|
@ -45,6 +45,7 @@ type Configuration struct {
|
|||
ReDownload string `json:"redownload"`
|
||||
ReBuild string `json:"rebuild"`
|
||||
AnswerClean string `json:"answerclean"`
|
||||
AnswerDiff string `json:"answerdiff"`
|
||||
AnswerEdit string `json:"answeredit"`
|
||||
AnswerUpgrade string `json:"answerupgrade"`
|
||||
GitBin string `json:"gitbin"`
|
||||
|
@ -167,6 +168,7 @@ func defaultSettings(config *Configuration) {
|
|||
config.ReDownload = "no"
|
||||
config.ReBuild = "no"
|
||||
config.AnswerClean = ""
|
||||
config.AnswerDiff = ""
|
||||
config.AnswerEdit = ""
|
||||
config.AnswerUpgrade = ""
|
||||
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) {
|
||||
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 {
|
||||
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 {
|
||||
fmt.Println(bold(green(arrow + " PKGBUILDs to edit?")))
|
||||
}
|
||||
fmt.Println(bold(green(arrow) + cyan(" [N]one ") + "[A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"))
|
||||
|
||||
fmt.Print(bold(green(arrow + " ")))
|
||||
|
||||
editInput, err := getInput(config.AnswerEdit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
fmt.Print(bold(green(arrow + " ")))
|
||||
editInput, err = getInput(config.AnswerEdit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
eInclude, eExclude, eOtherInclude, eOtherExclude := parseNumberMenu(editInput)
|
||||
|
|
Loading…
Reference in a new issue