refresh subcommand
()
| 228 | // refresh subcommand |
| 229 | |
| 230 | func newAuthRefreshCommand() *cobra.Command { |
| 231 | return &cobra.Command{ |
| 232 | Use: "refresh", |
| 233 | Short: "Force token refresh", |
| 234 | RunE: func(cmd *cobra.Command, args []string) error { |
| 235 | ctx := context.Background() |
| 236 | if err := authMgr.Refresh(ctx); err != nil { |
| 237 | return output.ErrAuth(fmt.Sprintf("refresh failed: %v", err)) |
| 238 | } |
| 239 | if writer.IsStyled() { |
| 240 | fmt.Fprintln(cmd.OutOrStdout(), "Token refreshed.") |
| 241 | return nil |
| 242 | } |
| 243 | return writeOK(nil, output.WithSummary("Token refreshed")) |
| 244 | }, |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | // token subcommand |
| 249 |
no test coverage detected