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 000000000..eb4024e5c --- /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 15d4048da..38716eb7d 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 036b7c4c8..c366edf83 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 4a4521a51..0ad70292e 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 eee8da376..ae36c5cdc 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 84dec29bb..7681feb74 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 1d35b6d4f..3d8b820b4 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 16782899d..a452acfdb 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 2344976f6..b8ef9d66b 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 cfc5ecb6c..ded382c6a 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 41447fec0..6e9230039 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 3e2627d1d..4be4fe6c9 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 dd65d0339..af71e93b0 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 cea462af1..d5cec2a23 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 88720c61c..e81f3f899 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 40bf8651c..0fec2f10a 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 7a019f77c..de65b4a89 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 4c009ecce..1c5573152 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 91877f8e6..ca1bfd40d 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 ab9dca8ae..9b43562d8 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 d03ca62ac..806e91742 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 cf18ac356..0998b8cf3 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 1a3c9febb..d54834983 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 7a42d3588..9b732823d 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 4bbda8f16..84ece22a2 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 12feaf072..e858d2935 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 beec4cf33..955284098 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 002a98b4b..639f68e51 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 f7092994e..79ab201e7 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 8571cfdf0..f0ca9e55c 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 4c6cf6db3..3c7a288f9 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 68538952e..fd93235c7 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 e4cf353d4..35c2d9dd3 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 544474c42..a8919b23b 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 {