mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CLI: Conver account flag to required arg
Follows the same convention as other commands.
This commit is contained in:
parent
f2e9ec63df
commit
7c8fa067a2
@ -24,10 +24,6 @@ var ImportJson = cli.Command{
|
|||||||
Name: "dir",
|
Name: "dir",
|
||||||
Usage: "path to folder containing json dashboards",
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
accountName := c.String("account")
|
if !c.Args().Present() {
|
||||||
if len(accountName) == 0 {
|
log.ConsoleFatal("Account name arg is required")
|
||||||
log.Error(3, "Missing command flag --account")
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
accountName := c.Args().First()
|
||||||
|
|
||||||
setting.NewConfigContext()
|
setting.NewConfigContext()
|
||||||
sqlstore.NewEngine()
|
sqlstore.NewEngine()
|
||||||
sqlstore.EnsureAdminUser()
|
sqlstore.EnsureAdminUser()
|
||||||
|
Loading…
Reference in New Issue
Block a user