MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / PromptMissing

Function PromptMissing

pkg/cmd/user/delete/delete.go:105–123  ·  view source on GitHub ↗
(opts *DeleteOptions)

Source from the content-addressed store, hash-verified

103}
104
105func PromptMissing(opts *DeleteOptions) error {
106 if opts.UsernameOrId == "" {
107 existingUsers, err := opts.Client.Users.GetAll()
108 if err != nil {
109 return err
110 }
111 itemToDelete, err := selectors.Select(opts.Ask, "Select the user you wish to delete:", func() ([]*users.User, error) {
112 return existingUsers, nil
113 }, func(item *users.User) string {
114 return item.DisplayName
115 })
116 if err != nil {
117 return err
118 }
119 opts.UsernameOrId = itemToDelete.GetID()
120 }
121
122 return nil
123}
124
125func deleteUser(client *client.Client, user *users.User) error {
126 return client.Users.DeleteByID(user.GetID())

Callers 1

deleteRunFunction · 0.70

Calls 1

SelectFunction · 0.92

Tested by

no test coverage detected