Minor changes to command templates

This commit is contained in:
Harshavardhana 2015-07-05 10:13:24 -07:00
parent 486b82e950
commit adc0a1063c
1 changed files with 7 additions and 10 deletions

View File

@ -10,7 +10,7 @@ import (
var commands = []cli.Command{ var commands = []cli.Command{
serverCmd, serverCmd,
controlCmd, controllerCmd,
} }
var serverCmd = cli.Command{ var serverCmd = cli.Command{
@ -25,13 +25,13 @@ USAGE:
EXAMPLES: EXAMPLES:
1. Start in server mode 1. Start in server mode
$ minio server $ minio {{.Name}}
`, `,
} }
var controlCmd = cli.Command{ var controllerCmd = cli.Command{
Name: "control", Name: "controller",
Description: "Control mode", Description: "Control mode",
Action: runController, Action: runController,
CustomHelpTemplate: `NAME: CustomHelpTemplate: `NAME:
@ -42,12 +42,12 @@ USAGE:
EXAMPLES: EXAMPLES:
1. Start in controller mode 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") certFile := c.GlobalString("cert")
keyFile := c.GlobalString("key") keyFile := c.GlobalString("key")
if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") { if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") {
@ -68,7 +68,7 @@ func runServer(c *cli.Context) {
if err != nil { if err != nil {
Fatalf("Unable to determine current user. Reason: %s\n", err) Fatalf("Unable to determine current user. Reason: %s\n", err)
} }
apiServerConfig := getAPIServerConfig(c) apiServerConfig := getServerConfig(c)
if err := server.StartServices(apiServerConfig); err != nil { if err := server.StartServices(apiServerConfig); err != nil {
Fatalln(err) Fatalln(err)
} }
@ -79,7 +79,4 @@ func runController(c *cli.Context) {
if err != nil { if err != nil {
Fatalf("Unable to determine current user. Reason: %s\n", err) 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
}
} }