(env *execenv.Env)
| 15 | } |
| 16 | |
| 17 | func newUserNewCommand(env *execenv.Env) *cobra.Command { |
| 18 | options := userNewOptions{} |
| 19 | cmd := &cobra.Command{ |
| 20 | Use: "new", |
| 21 | Short: "Create a new identity", |
| 22 | PreRunE: execenv.LoadBackend(env), |
| 23 | RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error { |
| 24 | return runUserNew(env, options) |
| 25 | }), |
| 26 | } |
| 27 | |
| 28 | flags := cmd.Flags() |
| 29 | flags.StringVarP(&options.name, "name", "n", "", "Name to identify the user") |
| 30 | flags.StringVarP(&options.email, "email", "e", "", "Email of the user") |
| 31 | flags.StringVarP(&options.avatarURL, "avatar", "a", "", "Avatar URL") |
| 32 | flags.BoolVar(&options.nonInteractive, "non-interactive", false, "Do not ask for user input") |
| 33 | |
| 34 | return cmd |
| 35 | } |
| 36 | |
| 37 | func runUserNew(env *execenv.Env, opts userNewOptions) error { |
| 38 |
no test coverage detected