From c3903d69f9d5228bcacccb06ae30875f485f850a Mon Sep 17 00:00:00 2001 From: Arnaud Porterie Date: Tue, 28 Apr 2015 09:47:06 -0700 Subject: [PATCH] Fast exit from create on invalid command-line The `create` command now fails immediately when invoked with an invalid command-line rather than going as far as initializing discovery and creating a cluster. Signed-off-by: Arnaud Porterie --- cli/cli.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index a38fc11b3e..98ed2797e1 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -60,12 +60,12 @@ func Run() { ShortName: "c", Usage: "create a cluster", Action: func(c *cli.Context) { - discovery := &token.Discovery{} - discovery.Initialize("", 0) - token, err := discovery.CreateCluster() if len(c.Args()) != 0 { log.Fatalf("the `create` command takes no arguments. See '%s create --help'.", c.App.Name) } + discovery := &token.Discovery{} + discovery.Initialize("", 0) + token, err := discovery.CreateCluster() if err != nil { log.Fatal(err) }