References #147. Sudo loop is off by default

This commit is contained in:
Jguer 2018-02-16 13:14:59 +00:00
parent 4075d37246
commit 9f734bdf8d
2 changed files with 7 additions and 2 deletions

7
cmd.go
View file

@ -291,7 +291,7 @@ func handleCmd() (err error) {
}
}
if cmdArgs.needRoot() {
if config.SudoLoop == true && cmdArgs.needRoot() {
go sudoLoop()
}
@ -655,7 +655,10 @@ func numberMenu(pkgS []string, flags []string) (err error) {
aurI = removeListFromList(aurNI, aurI)
repoI = removeListFromList(repoNI, repoI)
go sudoLoop()
if config.SudoLoop == true {
go sudoLoop()
}
arguments := makeArguments()
arguments.addTarget(repoI...)
arguments.addTarget(aurI...)

View file

@ -33,6 +33,7 @@ type Configuration struct {
RequestSplitN int `json:"requestsplitn"`
SearchMode int `json:"-"`
SortMode int `json:"sortmode"`
SudoLoop bool `json:"sudoloop"`
TimeUpdate bool `json:"timeupdate"`
NoConfirm bool `json:"noconfirm"`
Devel bool `json:"devel"`
@ -109,6 +110,7 @@ func defaultSettings(config *Configuration) {
config.PacmanBin = "/usr/bin/pacman"
config.PacmanConf = "/etc/pacman.conf"
config.SortMode = BottomUp
config.SudoLoop = false
config.TarBin = "/usr/bin/bsdtar"
config.TimeUpdate = false
config.RequestSplitN = 150