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