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

Function NewUsersCommand

cmd/get/users.go:11–31  ·  view source on GitHub ↗

NewUsersCommand creates and returns the cobra command for retrieving username entries.

()

Source from the content-addressed store, hash-verified

9
10// NewUsersCommand creates and returns the cobra command for retrieving username entries.
11func NewUsersCommand() *cobra.Command {
12 cmd := &cobra.Command{
13 Use: "users <username>",
14 Short: "Get alternative usernames",
15 Long: "Get alternative usernames",
16 Aliases: []string{"user", "usr"},
17 Run: func(_ *cobra.Command, args []string) {
18 var username string
19 if len(args) > 0 {
20 username = args[0]
21 }
22 configuration, err := config.LoadConfig()
23 if err != nil {
24 utils.Fatalln(err)
25 }
26 controller := control.NewGetController(control.TypeUsers, username, configuration)
27 controller.ExecuteGet()
28 },
29 }
30 return cmd
31}

Callers 5

TestNewUsersCommand_LongFunction · 0.70
NewGetCommandFunction · 0.70

Calls 4

ExecuteGetMethod · 0.95
LoadConfigFunction · 0.92
FatallnFunction · 0.92
NewGetControllerFunction · 0.92