mirror of https://github.com/minio/minio.git
Minor changes to command templates
This commit is contained in:
parent
486b82e950
commit
adc0a1063c
17
commands.go
17
commands.go
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
var commands = []cli.Command{
|
||||
serverCmd,
|
||||
controlCmd,
|
||||
controllerCmd,
|
||||
}
|
||||
|
||||
var serverCmd = cli.Command{
|
||||
|
@ -25,13 +25,13 @@ USAGE:
|
|||
|
||||
EXAMPLES:
|
||||
1. Start in server mode
|
||||
$ minio server
|
||||
$ minio {{.Name}}
|
||||
|
||||
`,
|
||||
}
|
||||
|
||||
var controlCmd = cli.Command{
|
||||
Name: "control",
|
||||
var controllerCmd = cli.Command{
|
||||
Name: "controller",
|
||||
Description: "Control mode",
|
||||
Action: runController,
|
||||
CustomHelpTemplate: `NAME:
|
||||
|
@ -42,12 +42,12 @@ USAGE:
|
|||
|
||||
EXAMPLES:
|
||||
1. Start in controller mode
|
||||
$ minio control
|
||||
$ minio {{.Name}}
|
||||
|
||||
`,
|
||||
}
|
||||
|
||||
func getAPIServerConfig(c *cli.Context) api.Config {
|
||||
func getServerConfig(c *cli.Context) api.Config {
|
||||
certFile := c.GlobalString("cert")
|
||||
keyFile := c.GlobalString("key")
|
||||
if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") {
|
||||
|
@ -68,7 +68,7 @@ func runServer(c *cli.Context) {
|
|||
if err != nil {
|
||||
Fatalf("Unable to determine current user. Reason: %s\n", err)
|
||||
}
|
||||
apiServerConfig := getAPIServerConfig(c)
|
||||
apiServerConfig := getServerConfig(c)
|
||||
if err := server.StartServices(apiServerConfig); err != nil {
|
||||
Fatalln(err)
|
||||
}
|
||||
|
@ -79,7 +79,4 @@ func runController(c *cli.Context) {
|
|||
if err != nil {
|
||||
Fatalf("Unable to determine current user. Reason: %s\n", err)
|
||||
}
|
||||
if len(c.Args()) < 1 {
|
||||
cli.ShowCommandHelpAndExit(c, "control", 1) // last argument is exit code
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue