MCPcopy Create free account
hub / github.com/Driver-C/tryssh / NewUsersCommand

Function NewUsersCommand

cmd/create/users.go:11–29  ·  view source on GitHub ↗

NewUsersCommand creates and returns the cobra command for creating a username entry.

()

Source from the content-addressed store, hash-verified

9
10// NewUsersCommand creates and returns the cobra command for creating a username entry.
11func NewUsersCommand() *cobra.Command {
12 cmd := &cobra.Command{
13 Use: "users <username>",
14 Args: cobra.ExactArgs(1),
15 Short: "Create an alternative username",
16 Long: "Create an alternative username",
17 Aliases: []string{"user", "usr"},
18 Run: func(_ *cobra.Command, args []string) {
19 username := args[0]
20 configuration, err := config.LoadConfig()
21 if err != nil {
22 utils.Fatalln(err)
23 }
24 controller := control.NewCreateController(control.TypeUsers, username, configuration)
25 controller.ExecuteCreate()
26 },
27 }
28 return cmd
29}

Calls 4

ExecuteCreateMethod · 0.95
LoadConfigFunction · 0.92
FatallnFunction · 0.92
NewCreateControllerFunction · 0.92