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
|
||||
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
|
||||
|
|
20
install.go
20
install.go
|
@ -477,20 +477,26 @@ 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?")))
|
||||
} 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)
|
||||
editInput, err = getInput(config.AnswerDiff)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
fmt.Println(bold(green(arrow + " PKGBUILDs to edit?")))
|
||||
fmt.Print(bold(green(arrow + " ")))
|
||||
editInput, err = getInput(config.AnswerEdit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
eInclude, eExclude, eOtherInclude, eOtherExclude := parseNumberMenu(editInput)
|
||||
eIsInclude := len(eExclude) == 0 && len(eOtherExclude) == 0
|
||||
|
|
|
@ -469,6 +469,8 @@ func hasParam(arg string) bool {
|
|||
return true
|
||||
case "answerclean":
|
||||
return true
|
||||
case "answerdiff":
|
||||
return true
|
||||
case "answeredit":
|
||||
return true
|
||||
case "answerupgrade":
|
||||
|
|
Loading…
Reference in a new issue