mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-03 17:29:22 -05:00
improve command description
This commit is contained in:
committed by
Jörn Friedrich Dreyer
parent
c92dca658a
commit
1e38150276
@@ -11,9 +11,9 @@ import (
|
||||
// AccountsCommand is the entrypoint for the accounts command.
|
||||
func AccountsCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "accounts",
|
||||
Usage: "Start accounts server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.Accounts.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Accounts.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package command
|
||||
|
||||
import "github.com/urfave/cli/v2"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func handleOriginalAction(c *cli.Context, cmd *cli.Command) error {
|
||||
|
||||
@@ -12,3 +16,7 @@ func handleOriginalAction(c *cli.Context, cmd *cli.Command) error {
|
||||
|
||||
return cli.HandleAction(cmd.Action, c)
|
||||
}
|
||||
|
||||
func subcommandDescription(serviceName string) string {
|
||||
return fmt.Sprintf("%s extension commands", serviceName)
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// GLAuthCommand is the entrypoint for the glauth command.
|
||||
func GLAuthCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "glauth",
|
||||
Usage: "Start glauth server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.GLAuth.Service.Name,
|
||||
Usage: subcommandDescription(cfg.GLAuth.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// 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",
|
||||
Name: cfg.Graph.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Graph.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// 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",
|
||||
Name: cfg.GraphExplorer.Service.Name,
|
||||
Usage: subcommandDescription(cfg.GraphExplorer.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// IDPCommand is the entrypoint for the idp command.
|
||||
func IDPCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "idp",
|
||||
Usage: "Start idp server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.IDP.Service.Name,
|
||||
Usage: subcommandDescription(cfg.IDP.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -16,8 +16,8 @@ import (
|
||||
func KillCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "kill",
|
||||
Usage: "Kill an extension by name",
|
||||
Category: "Runtime",
|
||||
Usage: "kill an extension by name in the runtime (supervised mode)",
|
||||
Category: "runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
func ListCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "list",
|
||||
Usage: "Lists running ocis extensions",
|
||||
Category: "Runtime",
|
||||
Usage: "list oCIS extensions running in the runtime (supervised mode)",
|
||||
Category: "runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// OCSCommand is the entrypoint for the ocs command.
|
||||
func OCSCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "ocs",
|
||||
Usage: "Start ocs server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.OCS.Service.Name,
|
||||
Usage: subcommandDescription(cfg.OCS.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// ProxyCommand is the entry point for the proxy command.
|
||||
func ProxyCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "proxy",
|
||||
Usage: "Start proxy server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.Proxy.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Proxy.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -17,8 +17,8 @@ import (
|
||||
func RunCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "run",
|
||||
Usage: "Runs an extension",
|
||||
Category: "Runtime",
|
||||
Usage: "run an extension by name in the runtime (supervised mode)",
|
||||
Category: "runtime",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "hostname",
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
func Server(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "server",
|
||||
Usage: "Start fullstack server",
|
||||
Category: "Fullstack",
|
||||
Usage: "start a fullstack server (runtime and all extensions in supervised mode)",
|
||||
Category: "fullstack",
|
||||
Before: func(c *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// SettingsCommand is the entry point for the settings command.
|
||||
func SettingsCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "settings",
|
||||
Usage: "Start settings server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.Settings.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Settings.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageAppProviderCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-app-provider",
|
||||
Usage: "Start storage app-provider service",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage app-provider service",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.AppProviderWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageAuthBasicCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-auth-basic",
|
||||
Usage: "Start storage auth-basic service",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage auth-basic service",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.AuthBasicWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -12,7 +12,7 @@ func StorageAuthBearerCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-auth-bearer",
|
||||
Usage: "Start storage auth-bearer service",
|
||||
Category: "Extensions",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.AuthBearerWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageAuthMachineCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-auth-machine",
|
||||
Usage: "Start storage auth-machine service",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage auth-machine service",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.AuthMachineWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageFrontendCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-frontend",
|
||||
Usage: "Start storage frontend",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage frontend",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.FrontendWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageGatewayCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-gateway",
|
||||
Usage: "Start storage gateway",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage gateway",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.GatewayWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageGroupProviderCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-groupprovider",
|
||||
Usage: "Start storage groupprovider service",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage groupprovider service",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.GroupsWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-metadata",
|
||||
Usage: "Start storage and data service for metadata",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage and data service for metadata",
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
},
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StoragePublicLinkCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-public-link",
|
||||
Usage: "Start storage public link storage",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage public link storage",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.StoragePublicLink(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageSharesCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-shares",
|
||||
Usage: "Start storage and data provider for /home/Shares mount",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage and data provider for shares jail",
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
},
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageSharingCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-sharing",
|
||||
Usage: "Start storage sharing service",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage sharing service",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.SharingWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageUserProviderCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-userprovider",
|
||||
Usage: "Start storage userprovider service",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage userprovider service",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.UsersWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
func StorageUsersCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-users",
|
||||
Usage: "Start storage and data provider for /users mount",
|
||||
Category: "Extensions",
|
||||
Usage: "start storage and data provider for /users mount",
|
||||
Category: "extensions",
|
||||
//Flags: flagset.StorageUsersWithConfig(cfg.Storage),
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
func StoreCommand(cfg *config.Config) *cli.Command {
|
||||
|
||||
return &cli.Command{
|
||||
Name: "store",
|
||||
Usage: "Start a go-micro store",
|
||||
Category: "Extensions",
|
||||
Name: cfg.Store.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Store.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -11,16 +11,12 @@ import (
|
||||
// ThumbnailsCommand is the entrypoint for the thumbnails command.
|
||||
func ThumbnailsCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "thumbnails",
|
||||
Usage: "Start thumbnails server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.Thumbnails.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Thumbnails.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.Server(cfg.Thumbnails)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
Subcommands: command.GetCommands(cfg.Thumbnails),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ import (
|
||||
func VersionCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "version",
|
||||
Usage: "Lists running services with version",
|
||||
Category: "Runtime",
|
||||
Usage: "print the version of this binary and all running extension instances",
|
||||
Category: "info",
|
||||
Action: func(c *cli.Context) error {
|
||||
fmt.Println("Version: " + version.String)
|
||||
fmt.Printf("Compiled: %s\n", version.Compiled())
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
// WebCommand is the entrypoint for the web command.
|
||||
func WebCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "web",
|
||||
Usage: "Start web server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.Web.Service.Name,
|
||||
Usage: subcommandDescription(cfg.Web.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
func WebDAVCommand(cfg *config.Config) *cli.Command {
|
||||
|
||||
return &cli.Command{
|
||||
Name: "webdav",
|
||||
Usage: "Start webdav server",
|
||||
Category: "Extensions",
|
||||
Name: cfg.WebDAV.Service.Name,
|
||||
Usage: subcommandDescription(cfg.WebDAV.Service.Name),
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user