MCPcopy Index your code
hub / github.com/git-bug/git-bug / newUserNewCommand

Function newUserNewCommand

commands/user/user_new.go:17–35  ·  view source on GitHub ↗
(env *execenv.Env)

Source from the content-addressed store, hash-verified

15}
16
17func 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
37func runUserNew(env *execenv.Env, opts userNewOptions) error {
38

Callers 1

NewUserCommandFunction · 0.85

Calls 3

LoadBackendFunction · 0.92
CloseBackendFunction · 0.92
runUserNewFunction · 0.85

Tested by

no test coverage detected