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

Function NewUsersCommand

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

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

()

Source from the content-addressed store, hash-verified

9
10// NewUsersCommand creates and returns the cobra command for deleting a username entry.
11func NewUsersCommand() *cobra.Command {
12 cmd := &cobra.Command{
13 Use: "users <username>",
14 Args: cobra.ExactArgs(1),
15 Short: "Delete an alternative username",
16 Long: "Delete 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.NewDeleteController(control.TypeUsers, username, configuration)
25 controller.ExecuteDelete()
26 },
27 }
28 return cmd
29}

Calls 4

ExecuteDeleteMethod · 0.95
LoadConfigFunction · 0.92
FatallnFunction · 0.92
NewDeleteControllerFunction · 0.92