refactor remaining code from urfave/cli
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
This commit is contained in:
committed by
Florian Schade
parent
a8545bfa39
commit
0372869b8b
@@ -6,7 +6,8 @@ import (
|
||||
"github.com/opencloud-eu/opencloud/pkg/log"
|
||||
"github.com/opencloud-eu/opencloud/services/web/pkg/config"
|
||||
"github.com/opencloud-eu/opencloud/services/web/pkg/metrics"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
@@ -19,7 +20,7 @@ type Options struct {
|
||||
Context context.Context
|
||||
Config *config.Config
|
||||
Metrics *metrics.Metrics
|
||||
Flags []cli.Flag
|
||||
Flags []pflag.Flag
|
||||
Namespace string
|
||||
TraceProvider trace.TracerProvider
|
||||
}
|
||||
@@ -76,3 +77,10 @@ func TraceProvider(val trace.TracerProvider) Option {
|
||||
o.TraceProvider = val
|
||||
}
|
||||
}
|
||||
|
||||
// Flags provides a function to set the flags option.
|
||||
func Flags(flags ...pflag.Flag) Option {
|
||||
return func(o *Options) {
|
||||
o.Flags = append(o.Flags, flags...)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user