Browse Source

CLI: Conver account flag to required arg

Follows the same convention as other commands.
Jason Wilder 11 years ago
parent
commit
7c8fa067a2
1 changed files with 4 additions and 8 deletions
  1. 4 8
      pkg/cmd/dashboard.go

+ 4 - 8
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()