diff --git a/internal/cli/apps.go b/internal/cli/apps.go index 100cf1dc9..83b71a8d6 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -1,6 +1,7 @@ package cli import ( + "errors" "fmt" "strings" @@ -680,3 +681,24 @@ func interfaceToStringSlice(s []interface{}) []string { } return result } + +func (c *cli) appPickerOptions() (pickerOptions, error) { + list, err := c.api.Client.List() + if err != nil { + return nil, err + } + + var opts pickerOptions + for _, c := range list.Clients { + opts = append(opts, pickerOption{ + value: c.GetClientID(), + label: c.GetName(), + }) + } + + if len(opts) == 0 { + return nil, errors.New("There are currently no applications.") + } + + return opts, nil +}