From 7c8fa067a2691f8fe4f7ec3cd5511c7a941f70f3 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Sun, 15 Feb 2015 13:48:36 -0700 Subject: [PATCH] CLI: Conver account flag to required arg Follows the same convention as other commands. --- pkg/cmd/dashboard.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/cmd/dashboard.go b/pkg/cmd/dashboard.go index f1f7f9fedb2..b37e06f4b8b 100644 --- a/pkg/cmd/dashboard.go +++ b/pkg/cmd/dashboard.go @@ -24,10 +24,6 @@ var ImportJson = cli.Command{ Name: "dir", Usage: "path to folder containing json dashboards", }, - cli.StringFlag{ - Name: "account", - Usage: "Account name to save dashboards under", - }, }, } @@ -49,12 +45,12 @@ func runImport(c *cli.Context) { return } - accountName := c.String("account") - if len(accountName) == 0 { - log.Error(3, "Missing command flag --account") - return + if !c.Args().Present() { + log.ConsoleFatal("Account name arg is required") } + accountName := c.Args().First() + setting.NewConfigContext() sqlstore.NewEngine() sqlstore.EnsureAdminUser()