Quellcode durchsuchen

CLI: Remove redundant Cmd prefix from commands

Jason Wilder vor 11 Jahren
Ursprung
Commit
ca4124940a
4 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen
  1. 2 2
      main.go
  2. 3 3
      pkg/cmd/accounts.go
  3. 1 1
      pkg/cmd/import.go
  4. 1 1
      pkg/cmd/web.go

+ 2 - 2
main.go

@@ -31,8 +31,8 @@ func main() {
 	app.Name = "Grafana Backend"
 	app.Usage = "grafana web"
 	app.Version = version
-	app.Commands = []cli.Command{cmd.CmdWeb, cmd.CmdImportJson,
-		cmd.CmdListAccounts, cmd.CmdCreateAccount, cmd.CmdDeleteAccount}
+	app.Commands = []cli.Command{cmd.Web, cmd.ImportJson,
+		cmd.ListAccounts, cmd.CreateAccount, cmd.DeleteAccount}
 	app.Flags = append(app.Flags, []cli.Flag{}...)
 	app.Run(os.Args)
 

+ 3 - 3
pkg/cmd/accounts.go

@@ -12,7 +12,7 @@ import (
 	"text/tabwriter"
 )
 
-var CmdListAccounts = cli.Command{
+var ListAccounts = cli.Command{
 	Name:        "account",
 	Usage:       "list accounts",
 	Description: "Lists the accounts in the system",
@@ -26,7 +26,7 @@ var CmdListAccounts = cli.Command{
 	},
 }
 
-var CmdCreateAccount = cli.Command{
+var CreateAccount = cli.Command{
 	Name:        "account:create",
 	Usage:       "create a new account",
 	Description: "Creates a new account",
@@ -40,7 +40,7 @@ var CmdCreateAccount = cli.Command{
 	},
 }
 
-var CmdDeleteAccount = cli.Command{
+var DeleteAccount = cli.Command{
 	Name:        "account:delete",
 	Usage:       "delete an existing account",
 	Description: "Deletes an existing account",

+ 1 - 1
pkg/cmd/import.go

@@ -14,7 +14,7 @@ import (
 	"github.com/grafana/grafana/pkg/setting"
 )
 
-var CmdImportJson = cli.Command{
+var ImportJson = cli.Command{
 	Name:        "import-json",
 	Usage:       "grafana import",
 	Description: "Starts Grafana import process",

+ 1 - 1
pkg/cmd/web.go

@@ -22,7 +22,7 @@ import (
 	"github.com/grafana/grafana/pkg/social"
 )
 
-var CmdWeb = cli.Command{
+var Web = cli.Command{
 	Name:        "web",
 	Usage:       "grafana web",
 	Description: "Starts Grafana backend & web server",