mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
Adding app/config/cli.go
This commit is contained in:
parent
57cc55b601
commit
49faaf5325
1 changed files with 17 additions and 0 deletions
17
app/config/cli.go
Normal file
17
app/config/cli.go
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path"
|
||||||
|
|
||||||
|
"github.com/urfave/cli/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (cfg *Config) ReadCliFlags(ctx *cli.Context) error {
|
||||||
|
logFile := ctx.Path("log")
|
||||||
|
if len(logFile) > 0 {
|
||||||
|
cfg.Log.Directory = path.Dir(logFile)
|
||||||
|
cfg.Log.Filename = path.Base(logFile)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue