cmdWithOpts wires runGetCmd to a custom GetOptions so tests can stub the auth seam (EnsureAuthenticated) or the dashboard client.
(opts *GetOptions)
| 30 | // cmdWithOpts wires runGetCmd to a custom GetOptions so tests can stub the |
| 31 | // auth seam (EnsureAuthenticated) or the dashboard client. |
| 32 | func cmdWithOpts(opts *GetOptions) *cobra.Command { |
| 33 | cmd := &cobra.Command{ |
| 34 | RunE: func(cmd *cobra.Command, args []string) error { |
| 35 | return runGetCmd(opts) |
| 36 | }, |
| 37 | } |
| 38 | opts.PrintFlags.AddFlags(cmd) |
| 39 | return cmd |
| 40 | } |
| 41 | |
| 42 | // When there's no usable session, auth get launches the login flow (here |
| 43 | // stubbed) and proceeds with the resulting identity. |
no test coverage detected