mirror of
https://github.com/openziti/zrok.git
synced 2024-12-23 15:18:52 +01:00
cmd lint
This commit is contained in:
parent
1d655a2b0d
commit
7f2afc13cd
@ -21,11 +21,11 @@ func newControllerCommand() *controllerCommand {
|
|||||||
Aliases: []string{"ctrl"},
|
Aliases: []string{"ctrl"},
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
}
|
}
|
||||||
ccmd := &controllerCommand{
|
command := &controllerCommand{
|
||||||
cmd: cmd,
|
cmd: cmd,
|
||||||
}
|
}
|
||||||
cmd.Run = ccmd.run
|
cmd.Run = command.run
|
||||||
return ccmd
|
return command
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *controllerCommand) run(_ *cobra.Command, args []string) {
|
func (cmd *controllerCommand) run(_ *cobra.Command, args []string) {
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
createCmd.AddCommand(createAccountCmd)
|
createCmd.AddCommand(newCreateAccountCommand().cmd)
|
||||||
rootCmd.AddCommand(createCmd)
|
rootCmd.AddCommand(createCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,10 +18,22 @@ var createCmd = &cobra.Command{
|
|||||||
Short: "Create objects",
|
Short: "Create objects",
|
||||||
}
|
}
|
||||||
|
|
||||||
var createAccountCmd = &cobra.Command{
|
type createAccountCommand struct {
|
||||||
|
cmd *cobra.Command
|
||||||
|
}
|
||||||
|
|
||||||
|
func newCreateAccountCommand() *createAccountCommand {
|
||||||
|
cmd := &cobra.Command{
|
||||||
Use: "account",
|
Use: "account",
|
||||||
Short: "create new zrok account",
|
Short: "Create new zrok account",
|
||||||
Run: func(_ *cobra.Command, _ []string) {
|
Args: cobra.ExactArgs(0),
|
||||||
|
}
|
||||||
|
command := &createAccountCommand{cmd: cmd}
|
||||||
|
cmd.Run = command.run
|
||||||
|
return command
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmd *createAccountCommand) run(_ *cobra.Command, _ []string) {
|
||||||
username, err := term.Prompt("New Username: ")
|
username, err := term.Prompt("New Username: ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -50,5 +62,4 @@ var createAccountCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
logrus.Infof("api token: %v", resp.Payload.Token)
|
logrus.Infof("api token: %v", resp.Payload.Token)
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user