Run executes the interactive application-selection flow and returns the chosen application. Other commands (e.g. open) use it to ensure an application is selected before proceeding. A nil application is returned when the account has no applications.
(f *cmdutil.Factory)
| 74 | // application is selected before proceeding. A nil application is returned |
| 75 | // when the account has no applications. |
| 76 | func Run(f *cmdutil.Factory) (*dashboard.Application, error) { |
| 77 | opts := &SelectOptions{ |
| 78 | IO: f.IOStreams, |
| 79 | Config: f.Config, |
| 80 | NewDashboardClient: func(clientID string) *dashboard.Client { |
| 81 | return dashboard.NewClient(clientID) |
| 82 | }, |
| 83 | } |
| 84 | |
| 85 | return runSelectCmd(opts) |
| 86 | } |
| 87 | |
| 88 | func runSelectCmd(opts *SelectOptions) (*dashboard.Application, error) { |
| 89 | cs := opts.IO.ColorScheme() |
no test coverage detected