Implement config option for provider searching

This commit is contained in:
morganamilo 2018-05-29 17:39:38 +01:00
parent 33d056e9ac
commit c464af6b9b
No known key found for this signature in database
GPG Key ID: 6FE9E7996B0B082E
3 changed files with 7 additions and 6 deletions

4
cmd.go
View File

@ -296,6 +296,10 @@ func handleConfig(option, value string) bool {
config.SudoLoop = true
case "nosudoloop":
config.SudoLoop = false
case "provides":
config.Provides = true
case "noprovides":
config.Provides = false
default:
return false
}

View File

@ -54,6 +54,7 @@ type Configuration struct {
Devel bool `json:"devel"`
CleanAfter bool `json:"cleanAfter"`
GitClone bool `json:"gitclone"`
Provides bool `json:"provides"`
}
var version = "5.688"
@ -152,6 +153,7 @@ func defaultSettings(config *Configuration) {
config.AnswerEdit = ""
config.AnswerUpgrade = ""
config.GitClone = true
config.Provides = true
}
// Editor returns the preferred system editor.

View File

@ -9,8 +9,6 @@ import (
rpc "github.com/mikkeloscar/aur"
)
const PROVIDES = true
type target struct {
Db string
Name string
@ -228,10 +226,7 @@ func (dp *depPool) cacheAURPackages(_pkgs stringSet) error {
return nil
}
//TODO: config option, maybe --deepsearh but aurman uses that flag for
//something else already which might be confusing
//maybe --provides
if PROVIDES {
if config.Provides {
err := dp.findProvides(pkgs)
if err != nil {
return err