add missing commands and unify service / namespace options

This commit is contained in:
Willy Kloucek
2022-01-03 07:49:23 +01:00
parent de87f3160d
commit 6206fe2398
66 changed files with 515 additions and 218 deletions
+42
View File
@@ -0,0 +1,42 @@
//go:build !simple
// +build !simple
package command
import (
"github.com/owncloud/ocis/graph/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)
// GraphCommand is the entrypoint for the graph command.
func GraphCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "graph",
Usage: "Start graph server",
Category: "Extensions",
Before: func(ctx *cli.Context) error {
if err := ParseConfig(ctx, cfg); err != nil {
return err
}
if cfg.Commons != nil {
cfg.Graph.Commons = cfg.Commons
}
return nil
},
Action: func(c *cli.Context) error {
origCmd := command.Server(cfg.Graph)
return handleOriginalAction(c, origCmd)
},
Subcommands: []*cli.Command{
command.PrintVersion(cfg.Graph),
},
}
}
func init() {
register.AddCommand(GraphCommand)
}
+42
View File
@@ -0,0 +1,42 @@
//go:build !simple
// +build !simple
package command
import (
"github.com/owncloud/ocis/graph-explorer/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
)
// GraphExplorerCommand is the entrypoint for the graph-explorer command.
func GraphExplorerCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "graph-explorer",
Usage: "Start graph-explorer server",
Category: "Extensions",
Before: func(ctx *cli.Context) error {
if err := ParseConfig(ctx, cfg); err != nil {
return err
}
if cfg.Commons != nil {
cfg.Graph.Commons = cfg.Commons
}
return nil
},
Action: func(c *cli.Context) error {
origCmd := command.Server(cfg.GraphExplorer)
return handleOriginalAction(c, origCmd)
},
Subcommands: []*cli.Command{
command.PrintVersion(cfg.GraphExplorer),
},
}
}
func init() {
register.AddCommand(GraphExplorerCommand)
}
+1 -1
View File
@@ -16,7 +16,7 @@ func StorageAuthMachineCommand(cfg *config.Config) *cli.Command {
Name: "storage-auth-machine",
Usage: "Start storage auth-machine service",
Category: "Extensions",
//Flags: flagset.AuthBearerWithConfig(cfg.Storage),
//Flags: flagset.AuthMachineWithConfig(cfg.Storage),
Before: func(ctx *cli.Context) error {
return ParseStorageCommon(ctx, cfg)
},