mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-01 18:01:28 -06:00
39 lines
960 B
Go
39 lines
960 B
Go
package flagset
|
|
|
|
import (
|
|
"github.com/micro/cli/v2"
|
|
"github.com/owncloud/ocis/storage/pkg/config"
|
|
)
|
|
|
|
// RootWithConfig applies cfg to the root flagset
|
|
func RootWithConfig(cfg *config.Config) []cli.Flag {
|
|
return []cli.Flag{
|
|
&cli.StringFlag{
|
|
Name: "config-file",
|
|
Value: "",
|
|
Usage: "Path to config file",
|
|
EnvVars: []string{"STORAGE_CONFIG_FILE"},
|
|
Destination: &cfg.File,
|
|
},
|
|
&cli.StringFlag{
|
|
Name: "log-level",
|
|
Value: "info",
|
|
Usage: "Set logging level",
|
|
EnvVars: []string{"STORAGE_LOG_LEVEL"},
|
|
Destination: &cfg.Log.Level,
|
|
},
|
|
&cli.BoolFlag{
|
|
Name: "log-pretty",
|
|
Usage: "Enable pretty logging",
|
|
EnvVars: []string{"STORAGE_LOG_PRETTY"},
|
|
Destination: &cfg.Log.Pretty,
|
|
},
|
|
&cli.BoolFlag{
|
|
Name: "log-color",
|
|
Usage: "Enable colored logging",
|
|
EnvVars: []string{"STORAGE_LOG_COLOR"},
|
|
Destination: &cfg.Log.Color,
|
|
},
|
|
}
|
|
}
|