Add --gitflags and --[no]gitclone flags

This commit is contained in:
morganamilo 2018-03-29 00:36:53 +01:00 committed by Jguer
parent 55fe22c430
commit 6d876a738c
3 changed files with 12 additions and 0 deletions

6
cmd.go
View File

@ -253,10 +253,16 @@ func handleConfig(option, value string) bool {
config.AnswerUpgrade = value
case "noanswerupgrade":
config.AnswerUpgrade = ""
case "gitclone":
config.GitClone = true
case "nogitclone":
config.GitClone = false
case "gpgflags":
config.GpgFlags = value
case "mflags":
config.MFlags = value
case "gitflags":
config.GitFlags = value
case "builddir":
config.BuildDir = value
case "editor":

View File

@ -44,6 +44,7 @@ type Configuration struct {
GpgFlags string `json:"gpgflags"`
MFlags string `json:"mflags"`
SortBy string `json:"sortby"`
GitFlags string `json:"gitflags"`
RequestSplitN int `json:"requestsplitn"`
SearchMode int `json:"-"`
SortMode int `json:"sortmode"`
@ -52,6 +53,7 @@ type Configuration struct {
NoConfirm bool `json:"-"`
Devel bool `json:"devel"`
CleanAfter bool `json:"cleanAfter"`
GitClone bool `json:"gitclone"`
}
var version = "3.373"
@ -141,6 +143,7 @@ func defaultSettings(config *Configuration) {
config.PacmanConf = "/etc/pacman.conf"
config.GpgFlags = ""
config.MFlags = ""
config.GitFlags = ""
config.SortMode = BottomUp
config.SortBy = "votes"
config.SudoLoop = false
@ -154,6 +157,7 @@ func defaultSettings(config *Configuration) {
config.AnswerClean = ""
config.AnswerEdit = ""
config.AnswerUpgrade = ""
config.GitClone = true
}
// Editor returns the preferred system editor.

View File

@ -429,6 +429,8 @@ func hasParam(arg string) bool {
return true
case "gpgflags":
return true
case "gitflags":
return true
case "builddir":
return true
case "editor":