mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 12:19:37 -06:00
fix flag parsing
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/flagset"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@@ -28,8 +27,6 @@ func Execute(cfg *config.Config) error {
|
||||
},
|
||||
},
|
||||
|
||||
Flags: flagset.RootWithConfig(cfg),
|
||||
|
||||
Before: func(c *cli.Context) error {
|
||||
cfg.Server.Version = version.String
|
||||
return nil
|
||||
|
||||
@@ -140,7 +140,7 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
grpc.Namespace(cfg.Server.Namespace),
|
||||
grpc.Address(cfg.Server.Address),
|
||||
grpc.Metrics(metrics),
|
||||
grpc.Flags(flagset.RootWithConfig(config.New())),
|
||||
//grpc.Flags(flagset.RootWithConfig(config.New())),
|
||||
)
|
||||
|
||||
gr.Add(func() error {
|
||||
|
||||
@@ -8,8 +8,21 @@ import (
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
||||
)
|
||||
|
||||
// RootWithConfig applies cfg to the root flagset
|
||||
func RootWithConfig(cfg *config.Config) []cli.Flag {
|
||||
// HealthWithConfig applies cfg to the root flagset
|
||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9189",
|
||||
Usage: "Address to debug endpoint",
|
||||
EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"},
|
||||
Destination: &cfg.Debug.Addr,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ServerWithConfig applies cfg to the root flagset
|
||||
func ServerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "log-level",
|
||||
@@ -29,25 +42,6 @@ func RootWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"THUMBNAILS_LOG_COLOR", "OCIS_LOG_COLOR"},
|
||||
Destination: &cfg.Log.Color,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// HealthWithConfig applies cfg to the root flagset
|
||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9189",
|
||||
Usage: "Address to debug endpoint",
|
||||
EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"},
|
||||
Destination: &cfg.Debug.Addr,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ServerWithConfig applies cfg to the root flagset
|
||||
func ServerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "config-file",
|
||||
Value: "",
|
||||
|
||||
Reference in New Issue
Block a user