config from env and log to file
This commit is contained in:
@ -64,6 +64,10 @@ func setupDI() cli.BeforeFunc {
|
||||
}
|
||||
|
||||
cfgpath := cmd.String("config")
|
||||
if cfgpath == "" {
|
||||
return errors.New("no config path provided")
|
||||
}
|
||||
|
||||
debugLevel := cmd.Bool("verbose")
|
||||
jsonFormat := cmd.Bool("json")
|
||||
|
||||
@ -96,9 +100,12 @@ func setupCLI() *cli.Command {
|
||||
Version: fmt.Sprintf("%s (%s) %s", rooteway.Version(), rooteway.Commit(), rooteway.BuildTime()),
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "config",
|
||||
Usage: "path to config in TOML format",
|
||||
Value: "config.toml",
|
||||
Name: "config",
|
||||
Usage: "path to config in TOML format",
|
||||
Value: "config.toml",
|
||||
Sources: cli.NewValueSourceChain(
|
||||
cli.EnvVar("EWAY_CONFIG"),
|
||||
),
|
||||
TakesFile: true,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
|
||||
Reference in New Issue
Block a user