'create account' -> 'invite'

This commit is contained in:
Michael Quigley 2022-09-23 15:56:50 -04:00
parent 340534f06a
commit b913aaee85
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -9,31 +9,25 @@ import (
) )
func init() { func init() {
createCmd.AddCommand(newCreateAccountCommand().cmd) rootCmd.AddCommand(newInviteCommand().cmd)
rootCmd.AddCommand(createCmd)
} }
var createCmd = &cobra.Command{ type inviteCommand struct {
Use: "create",
Short: "Create objects",
}
type createAccountCommand struct {
cmd *cobra.Command cmd *cobra.Command
} }
func newCreateAccountCommand() *createAccountCommand { func newInviteCommand() *inviteCommand {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "account", Use: "invite",
Short: "Create new zrok account", Short: "Invite a new user to zrok",
Args: cobra.ExactArgs(0), Args: cobra.ExactArgs(0),
} }
command := &createAccountCommand{cmd: cmd} command := &inviteCommand{cmd: cmd}
cmd.Run = command.run cmd.Run = command.run
return command return command
} }
func (cmd *createAccountCommand) run(_ *cobra.Command, _ []string) { func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) {
email, err := term.Prompt("New Email: ") email, err := term.Prompt("New Email: ")
if err != nil { if err != nil {
panic(err) panic(err)