Add --{no,ask}removemake

This commit is contained in:
morganamilo 2018-07-21 14:20:00 +01:00
parent 0e5cd51910
commit ec48698f35
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E
3 changed files with 13 additions and 1 deletions

6
cmd.go
View file

@ -326,6 +326,12 @@ func handleConfig(option, value string) bool {
mode = ModeAUR
case "repo":
mode = ModeRepo
case "removemake":
config.RemoveMake = "yes"
case "noremovemake":
config.RemoveMake = "no"
case "askremovemake":
config.RemoveMake = "ask"
default:
return false
}

View file

@ -54,6 +54,7 @@ type Configuration struct {
MFlags string `json:"mflags"`
SortBy string `json:"sortby"`
GitFlags string `json:"gitflags"`
RemoveMake string `json:"removemake"`
RequestSplitN int `json:"requestsplitn"`
SearchMode int `json:"-"`
SortMode int `json:"sortmode"`
@ -173,6 +174,7 @@ func defaultSettings(config *Configuration) {
config.AnswerDiff = ""
config.AnswerEdit = ""
config.AnswerUpgrade = ""
config.RemoveMake = "ask"
config.GitClone = true
config.Provides = true
config.UpgradeMenu = true

View file

@ -166,7 +166,11 @@ func install(parser *arguments) error {
fmt.Println()
if do.HasMake() {
if !continueTask("Remove make dependencies after install?", "yY") {
if config.RemoveMake == "yes" {
removeMake = true
} else if config.RemoveMake == "no" {
removeMake = false
} else if !continueTask("Remove make dependencies after install?", "yY") {
removeMake = true
}
}