displayDeprecationStatus displays timeline information. The `showCommands` flag controls whether to display helpful usage examples.
(cli *cli, showCommands bool)
| 408 | // displayDeprecationStatus displays timeline information. |
| 409 | // The `showCommands` flag controls whether to display helpful usage examples. |
| 410 | func displayDeprecationStatus(cli *cli, showCommands bool) error { |
| 411 | parsedSunset, _ := time.Parse("2006-01-02", sunsetDate) |
| 412 | now := time.Now() |
| 413 | daysUntil := int(parsedSunset.Sub(now).Hours() / 24) |
| 414 | formattedDate := ansi.Bold(ansi.Cyan(parsedSunset.Format("Jan 2, 2006"))) |
| 415 | |
| 416 | switch { |
| 417 | case daysUntil <= 0: |
| 418 | cli.renderer.Errorf("Advanced rendering mode was retired on %s", formattedDate) |
| 419 | cli.renderer.Errorf(" Use instead: %s", ansi.Green("auth0 acul config")) |
| 420 | if showCommands { |
| 421 | showNewConfigExamples(cli) |
| 422 | } |
| 423 | return fmt.Errorf("advanced rendering mode is no longer supported") |
| 424 | |
| 425 | case daysUntil <= warningPeriodDays: |
| 426 | cli.renderer.Output("") |
| 427 | cli.renderer.Output(ansi.Bold(ansi.Red("🚨 URGENT: DEPRECATION NOTICE 🚨"))) |
| 428 | cli.renderer.Warnf("%s will be retired soon (%d days left)", |
| 429 | ansi.Bold("Advanced rendering mode"), daysUntil) |
| 430 | cli.renderer.Warnf(" Switch to: %s", ansi.Bold(ansi.Cyan("auth0 acul config"))) |
| 431 | |
| 432 | if showCommands { |
| 433 | cli.renderer.Output("") |
| 434 | showNewConfigExamples(cli) |
| 435 | } |
| 436 | |
| 437 | cli.renderer.Warnf("⏳ Proceeding with advanced rendering mode (deprecated)") |
| 438 | |
| 439 | default: |
| 440 | cli.renderer.Output("") |
| 441 | cli.renderer.Output(ansi.Bold(ansi.Red("⚠️ DEPRECATION NOTICE ⚠️"))) |
| 442 | cli.renderer.Warnf("%s will be retired on %s (%d days remaining)", |
| 443 | ansi.Bold("Advanced rendering mode"), formattedDate, daysUntil) |
| 444 | cli.renderer.Warnf(" Try new commands: %s", ansi.Bold(ansi.Cyan("auth0 acul config"))) |
| 445 | if showCommands { |
| 446 | cli.renderer.Output("") |
| 447 | showNewConfigExamples(cli) |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | cli.renderer.Output("") |
| 452 | cli.renderer.Warnf(" For help: %s", ansi.Bold(ansi.Cyan("auth0 acul config --help"))) |
| 453 | cli.renderer.Output("") |
| 454 | |
| 455 | return nil |
| 456 | } |
| 457 | |
| 458 | // showNewConfigExamples displays example commands for managing ACUL configurations. |
| 459 | func showNewConfigExamples(cli *cli) { |
no test coverage detected