removed yet more flagsets

This commit is contained in:
A.Unger
2021-11-17 11:39:32 +01:00
parent f87b5bd66c
commit c567eb6eea
8 changed files with 19 additions and 173 deletions
+3 -2
View File
@@ -5,7 +5,6 @@ import (
"net/http"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)
@@ -15,7 +14,9 @@ func Health(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "health",
Usage: "Check health status",
Flags: flagset.HealthWithConfig(cfg),
Before: func(c *cli.Context) error {
return ParseConfig(c, cfg)
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
-19
View File
@@ -1,19 +0,0 @@
package flagset
import (
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/urfave/cli/v2"
)
// HealthWithConfig applies cfg to the root flag-set.
func HealthWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "debug-addr",
Value: "127.0.0.1:9010",
Usage: "Address to debug endpoint",
EnvVars: []string{"OCIS_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
}
}