From 44c909b31d171a38a813261e84734b167609cbd7 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 13 May 2022 16:36:39 +0200 Subject: [PATCH] unify ocis subcommands --- .../unreleased/fix-search-command-server-command.md | 8 ++++++++ .../pkg/command/{appprovider.go => app-provider.go} | 3 ++- ocis/pkg/command/app-registry.go | 3 ++- ocis/pkg/command/audit.go | 7 ++++--- ocis/pkg/command/auth-basic.go | 3 ++- ocis/pkg/command/auth-bearer.go | 3 ++- ocis/pkg/command/auth-machine.go | 3 ++- ocis/pkg/command/frontend.go | 3 ++- ocis/pkg/command/gateway.go | 3 ++- .../command/{graphexplorer.go => graph-explorer.go} | 3 ++- ocis/pkg/command/graph.go | 3 ++- ocis/pkg/command/groups.go | 3 ++- ocis/pkg/command/{ => helper}/common.go | 4 ++-- ocis/pkg/command/idm.go | 7 ++++--- ocis/pkg/command/idp.go | 3 ++- ocis/pkg/command/{natsserver.go => nats.go} | 3 ++- ocis/pkg/command/notifications.go | 7 ++++--- ocis/pkg/command/ocdav.go | 3 ++- ocis/pkg/command/ocs.go | 3 ++- ocis/pkg/command/proxy.go | 3 ++- ocis/pkg/command/root.go | 2 +- ocis/pkg/command/search.go | 13 ++++++++++--- ocis/pkg/command/server.go | 6 +++--- ocis/pkg/command/settings.go | 3 ++- ocis/pkg/command/sharing.go | 3 ++- ocis/pkg/command/storage-publiclink.go | 3 ++- ocis/pkg/command/storage-shares.go | 3 ++- .../{storage-metadata.go => storage-system.go} | 3 ++- ocis/pkg/command/storage-users.go | 3 ++- ocis/pkg/command/store.go | 3 ++- ocis/pkg/command/thumbnails.go | 3 ++- ocis/pkg/command/users.go | 3 ++- ocis/pkg/command/web.go | 3 ++- ocis/pkg/command/webdav.go | 3 ++- 34 files changed, 88 insertions(+), 44 deletions(-) create mode 100644 changelog/unreleased/fix-search-command-server-command.md rename ocis/pkg/command/{appprovider.go => app-provider.go} (86%) rename ocis/pkg/command/{graphexplorer.go => graph-explorer.go} (86%) rename ocis/pkg/command/{ => helper}/common.go (52%) rename ocis/pkg/command/{natsserver.go => nats.go} (86%) rename ocis/pkg/command/{storage-metadata.go => storage-system.go} (86%) diff --git a/changelog/unreleased/fix-search-command-server-command.md b/changelog/unreleased/fix-search-command-server-command.md new file mode 100644 index 00000000000..eb4024e5c11 --- /dev/null +++ b/changelog/unreleased/fix-search-command-server-command.md @@ -0,0 +1,8 @@ +Bugfix: Fix the `ocis search` command + +We've fixed the behavior for `ocis search`, which didn't show further help when not all secrets have been configured. +It also was not possible to start the search service standalone from the oCIS binary without configuring all oCIS secrets, +even they were not needed by the search service. + +https://github.com/owncloud/ocis/pull/3796 + diff --git a/ocis/pkg/command/appprovider.go b/ocis/pkg/command/app-provider.go similarity index 86% rename from ocis/pkg/command/appprovider.go rename to ocis/pkg/command/app-provider.go index 15d4048dab0..38716eb7ddf 100644 --- a/ocis/pkg/command/appprovider.go +++ b/ocis/pkg/command/app-provider.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/app-provider/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func AppProviderCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AppProvider.Service.Name, - Usage: subcommandDescription(cfg.AppProvider.Service.Name), + Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/app-registry.go b/ocis/pkg/command/app-registry.go index 036b7c4c85f..c366edf83d7 100644 --- a/ocis/pkg/command/app-registry.go +++ b/ocis/pkg/command/app-registry.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/app-registry/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func AppRegistryCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AppRegistry.Service.Name, - Usage: subcommandDescription(cfg.AppRegistry.Service.Name), + Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/audit.go b/ocis/pkg/command/audit.go index 4a4521a517d..0ad70292e65 100644 --- a/ocis/pkg/command/audit.go +++ b/ocis/pkg/command/audit.go @@ -6,15 +6,16 @@ import ( "github.com/owncloud/ocis/v2/extensions/audit/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) -// AuditCommand is the entrypoint for the audit command. +// AuditCommand is the entrypoint for the Audit command. func AuditCommand(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "audit", - Usage: "start audit service", + Name: cfg.Audit.Service.Name, + Usage: helper.SubcommandDescription(cfg.Audit.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/auth-basic.go b/ocis/pkg/command/auth-basic.go index eee8da37612..ae36c5cdc8e 100644 --- a/ocis/pkg/command/auth-basic.go +++ b/ocis/pkg/command/auth-basic.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/auth-basic/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func AuthBasicCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AuthBasic.Service.Name, - Usage: subcommandDescription(cfg.AuthBasic.Service.Name), + Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/auth-bearer.go b/ocis/pkg/command/auth-bearer.go index 84dec29bb8c..7681feb741c 100644 --- a/ocis/pkg/command/auth-bearer.go +++ b/ocis/pkg/command/auth-bearer.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/auth-bearer/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func AuthBearerCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AuthBearer.Service.Name, - Usage: subcommandDescription(cfg.AuthBearer.Service.Name), + Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/auth-machine.go b/ocis/pkg/command/auth-machine.go index 1d35b6d4fc0..3d8b820b4b1 100644 --- a/ocis/pkg/command/auth-machine.go +++ b/ocis/pkg/command/auth-machine.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/auth-machine/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func AuthMachineCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.AuthMachine.Service.Name, - Usage: subcommandDescription(cfg.AuthMachine.Service.Name), + Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/frontend.go b/ocis/pkg/command/frontend.go index 16782899d1b..a452acfdbfd 100644 --- a/ocis/pkg/command/frontend.go +++ b/ocis/pkg/command/frontend.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/frontend/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func FrontendCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Frontend.Service.Name, - Usage: subcommandDescription(cfg.Frontend.Service.Name), + Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/gateway.go b/ocis/pkg/command/gateway.go index 2344976f6b7..b8ef9d66b32 100644 --- a/ocis/pkg/command/gateway.go +++ b/ocis/pkg/command/gateway.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/gateway/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func GatewayCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Gateway.Service.Name, - Usage: subcommandDescription(cfg.Gateway.Service.Name), + Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/graphexplorer.go b/ocis/pkg/command/graph-explorer.go similarity index 86% rename from ocis/pkg/command/graphexplorer.go rename to ocis/pkg/command/graph-explorer.go index cfc5ecb6c2e..ded382c6ac0 100644 --- a/ocis/pkg/command/graphexplorer.go +++ b/ocis/pkg/command/graph-explorer.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/graph-explorer/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func GraphExplorerCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.GraphExplorer.Service.Name, - Usage: subcommandDescription(cfg.GraphExplorer.Service.Name), + Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/graph.go b/ocis/pkg/command/graph.go index 41447fec038..6e923003971 100644 --- a/ocis/pkg/command/graph.go +++ b/ocis/pkg/command/graph.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/graph/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func GraphCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Graph.Service.Name, - Usage: subcommandDescription(cfg.Graph.Service.Name), + Usage: helper.SubcommandDescription(cfg.Graph.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/groups.go b/ocis/pkg/command/groups.go index 3e2627d1d19..4be4fe6c973 100644 --- a/ocis/pkg/command/groups.go +++ b/ocis/pkg/command/groups.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/groups/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func GroupsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Groups.Service.Name, - Usage: subcommandDescription(cfg.Groups.Service.Name), + Usage: helper.SubcommandDescription(cfg.Groups.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/common.go b/ocis/pkg/command/helper/common.go similarity index 52% rename from ocis/pkg/command/common.go rename to ocis/pkg/command/helper/common.go index dd65d0339dc..af71e93b098 100644 --- a/ocis/pkg/command/common.go +++ b/ocis/pkg/command/helper/common.go @@ -1,9 +1,9 @@ -package command +package helper import ( "fmt" ) -func subcommandDescription(serviceName string) string { +func SubcommandDescription(serviceName string) string { return fmt.Sprintf("%s extension commands", serviceName) } diff --git a/ocis/pkg/command/idm.go b/ocis/pkg/command/idm.go index cea462af152..d5cec2a2341 100644 --- a/ocis/pkg/command/idm.go +++ b/ocis/pkg/command/idm.go @@ -6,15 +6,16 @@ import ( "github.com/owncloud/ocis/v2/extensions/idm/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) -// IDMCommand is the entrypoint for the idm server command. +// IDMCommand is the entrypoint for the idm command. func IDMCommand(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "idm", - Usage: "idm extension commands", + Name: cfg.IDM.Service.Name, + Usage: helper.SubcommandDescription(cfg.IDM.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/idp.go b/ocis/pkg/command/idp.go index 88720c61c7d..e81f3f899d1 100644 --- a/ocis/pkg/command/idp.go +++ b/ocis/pkg/command/idp.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/idp/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func IDPCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.IDP.Service.Name, - Usage: subcommandDescription(cfg.IDP.Service.Name), + Usage: helper.SubcommandDescription(cfg.IDP.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/natsserver.go b/ocis/pkg/command/nats.go similarity index 86% rename from ocis/pkg/command/natsserver.go rename to ocis/pkg/command/nats.go index 40bf8651c12..0fec2f10a2e 100644 --- a/ocis/pkg/command/natsserver.go +++ b/ocis/pkg/command/nats.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/nats/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func NatsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Nats.Service.Name, - Usage: subcommandDescription(cfg.Nats.Service.Name), + Usage: helper.SubcommandDescription(cfg.Nats.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/notifications.go b/ocis/pkg/command/notifications.go index 7a019f77c86..de65b4a89a9 100644 --- a/ocis/pkg/command/notifications.go +++ b/ocis/pkg/command/notifications.go @@ -6,15 +6,16 @@ import ( "github.com/owncloud/ocis/v2/extensions/notifications/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) -// NatsServerCommand is the entrypoint for the nats server command. +// NotificationsCommand is the entrypoint for the notifications command. func NotificationsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "notifications", - Usage: "start notifications service", + Name: cfg.Notifications.Service.Name, + Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/ocdav.go b/ocis/pkg/command/ocdav.go index 4c009ecce31..1c5573152b4 100644 --- a/ocis/pkg/command/ocdav.go +++ b/ocis/pkg/command/ocdav.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/ocdav/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func OCDavCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.OCDav.Service.Name, - Usage: subcommandDescription(cfg.OCDav.Service.Name), + Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/ocs.go b/ocis/pkg/command/ocs.go index 91877f8e650..ca1bfd40d70 100644 --- a/ocis/pkg/command/ocs.go +++ b/ocis/pkg/command/ocs.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/ocs/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func OCSCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.OCS.Service.Name, - Usage: subcommandDescription(cfg.OCS.Service.Name), + Usage: helper.SubcommandDescription(cfg.OCS.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index ab9dca8aed0..9b43562d81c 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/proxy/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func ProxyCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Proxy.Service.Name, - Usage: subcommandDescription(cfg.Proxy.Service.Name), + Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/root.go b/ocis/pkg/command/root.go index d03ca62acfe..806e917421b 100644 --- a/ocis/pkg/command/root.go +++ b/ocis/pkg/command/root.go @@ -15,7 +15,7 @@ func Execute() error { app := clihelper.DefaultApp(&cli.App{ Name: "ocis", - Usage: "ownCloud Infinite Scale Stack", + Usage: "ownCloud Infinite Scale", }) for _, fn := range register.Commands { diff --git a/ocis/pkg/command/search.go b/ocis/pkg/command/search.go index cf18ac356e1..0998b8cf34d 100644 --- a/ocis/pkg/command/search.go +++ b/ocis/pkg/command/search.go @@ -1,9 +1,12 @@ package command import ( + "fmt" + "github.com/owncloud/ocis/v2/extensions/search/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -12,10 +15,14 @@ import ( func SearchCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Search.Service.Name, - Usage: subcommandDescription(cfg.Search.Service.Name), + Usage: helper.SubcommandDescription(cfg.Search.Service.Name), Category: "extensions", - Before: func(ctx *cli.Context) error { - return parser.ParseConfig(cfg) + Before: func(c *cli.Context) error { + if err := parser.ParseConfig(cfg); err != nil { + fmt.Printf("%v", err) + } + cfg.Search.Commons = cfg.Commons + return nil }, Subcommands: command.GetCommands(cfg.Search), } diff --git a/ocis/pkg/command/server.go b/ocis/pkg/command/server.go index 1a3c9febb3c..d5483498312 100644 --- a/ocis/pkg/command/server.go +++ b/ocis/pkg/command/server.go @@ -17,11 +17,11 @@ func Server(cfg *config.Config) *cli.Command { Usage: "start a fullstack server (runtime and all extensions in supervised mode)", Category: "fullstack", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { + if err := parser.ParseConfig(cfg); err != nil { fmt.Printf("%v", err) + return err } - return err + return nil }, Action: func(c *cli.Context) error { r := runtime.New(cfg) diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index 7a42d3588a5..9b732823db8 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/settings/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func SettingsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Settings.Service.Name, - Usage: subcommandDescription(cfg.Settings.Service.Name), + Usage: helper.SubcommandDescription(cfg.Settings.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/sharing.go b/ocis/pkg/command/sharing.go index 4bbda8f1669..84ece22a29a 100644 --- a/ocis/pkg/command/sharing.go +++ b/ocis/pkg/command/sharing.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/sharing/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func SharingCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Sharing.Service.Name, - Usage: subcommandDescription(cfg.Sharing.Service.Name), + Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/storage-publiclink.go b/ocis/pkg/command/storage-publiclink.go index 12feaf0728f..e858d29351f 100644 --- a/ocis/pkg/command/storage-publiclink.go +++ b/ocis/pkg/command/storage-publiclink.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/storage-publiclink/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StoragePublicLink.Service.Name, - Usage: subcommandDescription(cfg.StoragePublicLink.Service.Name), + Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/storage-shares.go b/ocis/pkg/command/storage-shares.go index beec4cf3322..955284098d2 100644 --- a/ocis/pkg/command/storage-shares.go +++ b/ocis/pkg/command/storage-shares.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/storage-shares/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func StorageSharesCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StorageShares.Service.Name, - Usage: subcommandDescription(cfg.StorageShares.Service.Name), + Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/storage-metadata.go b/ocis/pkg/command/storage-system.go similarity index 86% rename from ocis/pkg/command/storage-metadata.go rename to ocis/pkg/command/storage-system.go index 002a98b4b62..639f68e5173 100644 --- a/ocis/pkg/command/storage-metadata.go +++ b/ocis/pkg/command/storage-system.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/storage-system/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func StorageSystemCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StorageSystem.Service.Name, - Usage: subcommandDescription(cfg.StorageSystem.Service.Name), + Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/storage-users.go b/ocis/pkg/command/storage-users.go index f7092994e2e..79ab201e7f7 100644 --- a/ocis/pkg/command/storage-users.go +++ b/ocis/pkg/command/storage-users.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/storage-users/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func StorageUsersCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.StorageUsers.Service.Name, - Usage: subcommandDescription(cfg.StorageUsers.Service.Name), + Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/store.go b/ocis/pkg/command/store.go index 8571cfdf00c..f0ca9e55c2f 100644 --- a/ocis/pkg/command/store.go +++ b/ocis/pkg/command/store.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/store/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -15,7 +16,7 @@ func StoreCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Store.Service.Name, - Usage: subcommandDescription(cfg.Store.Service.Name), + Usage: helper.SubcommandDescription(cfg.Store.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/thumbnails.go b/ocis/pkg/command/thumbnails.go index 4c6cf6db32b..3c7a288f905 100644 --- a/ocis/pkg/command/thumbnails.go +++ b/ocis/pkg/command/thumbnails.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/thumbnails/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func ThumbnailsCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Thumbnails.Service.Name, - Usage: subcommandDescription(cfg.Thumbnails.Service.Name), + Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/users.go b/ocis/pkg/command/users.go index 68538952e8a..fd93235c7a9 100644 --- a/ocis/pkg/command/users.go +++ b/ocis/pkg/command/users.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/users/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func UsersCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Users.Service.Name, - Usage: subcommandDescription(cfg.Users.Service.Name), + Usage: helper.SubcommandDescription(cfg.Users.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/web.go b/ocis/pkg/command/web.go index e4cf353d48a..35c2d9dd392 100644 --- a/ocis/pkg/command/web.go +++ b/ocis/pkg/command/web.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/web/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -14,7 +15,7 @@ import ( func WebCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.Web.Service.Name, - Usage: subcommandDescription(cfg.Web.Service.Name), + Usage: helper.SubcommandDescription(cfg.Web.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index 544474c42ec..a8919b23b53 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -6,6 +6,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/webdav/pkg/command" "github.com/owncloud/ocis/v2/ocis-pkg/config" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" + "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/urfave/cli/v2" ) @@ -15,7 +16,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: cfg.WebDAV.Service.Name, - Usage: subcommandDescription(cfg.WebDAV.Service.Name), + Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name), Category: "extensions", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil {