mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
internal/config/cli.go: Rename Config.ReadCliFlags to ovverideCliFlags and make it a function instead of method.
This commit is contained in:
parent
b4c305d8ea
commit
7033240000
2 changed files with 2 additions and 3 deletions
|
|
@ -93,7 +93,7 @@ func (b *Builder) Build() (*Config, error) {
|
|||
|
||||
// Call custom handler.
|
||||
if b.flags != nil {
|
||||
if err := conf.ReadCliFlags(b.flags); err != nil {
|
||||
if err := overrideCliFlags(&conf, b.flags); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ import (
|
|||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// Read cli flag values into the config
|
||||
func (cfg *Config) ReadCliFlags(flags *pflag.FlagSet) error {
|
||||
func overrideCliFlags(cfg *Config, flags *pflag.FlagSet) error {
|
||||
logFile, _ := flags.GetString("log")
|
||||
if len(logFile) > 0 {
|
||||
cfg.Log.Directory = path.Dir(logFile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue