Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Mar 23, 2021
1 parent bb424bf commit 4ed6caf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions internal/cli/apps.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cli

import (
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -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
}

0 comments on commit 4ed6caf

Please sign in to comment.