From adc0a1063c69f6a255512ed136869eaaadb882fd Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 5 Jul 2015 10:13:24 -0700 Subject: [PATCH] Minor changes to command templates --- commands.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/commands.go b/commands.go index 1aedd3b8d..2cae91df6 100644 --- a/commands.go +++ b/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 - } }