From 7cdd94e62667a0b1262459888fe3d908e5465910 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Mon, 9 Jan 2023 11:25:48 -0600 Subject: [PATCH] fix: Use right deprecation message based on arguments --- src/Recyclarr.Cli/Console/Commands/RadarrCommand.cs | 5 +++-- src/Recyclarr.Cli/Console/Commands/SonarrCommand.cs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Recyclarr.Cli/Console/Commands/RadarrCommand.cs b/src/Recyclarr.Cli/Console/Commands/RadarrCommand.cs index 93b07d3f..57a2faff 100644 --- a/src/Recyclarr.Cli/Console/Commands/RadarrCommand.cs +++ b/src/Recyclarr.Cli/Console/Commands/RadarrCommand.cs @@ -72,24 +72,25 @@ internal class RadarrCommand : AsyncCommand public override async Task ExecuteAsync(CommandContext context, CliSettings settings) { - _log.Warning("The `radarr` subcommand is DEPRECATED -- Use `sync` instead!"); - // Will throw if migration is required, otherwise just a warning is issued. _migration.CheckNeededMigrations(); await _repoUpdater.UpdateRepo(); if (settings.ListCustomFormats) { + _log.Warning("The `radarr` subcommand is DEPRECATED -- Use `list custom-formats radarr` instead!"); _lister.ListCustomFormats(); return 0; } if (settings.ListQualities) { + _log.Warning("The `radarr` subcommand is DEPRECATED -- Use `list qualities radarr` instead!"); _lister.ListQualities(); return 0; } + _log.Warning("The `radarr` subcommand is DEPRECATED -- Use `sync` instead!"); return (int) await _syncProcessor.ProcessConfigs(settings); } } diff --git a/src/Recyclarr.Cli/Console/Commands/SonarrCommand.cs b/src/Recyclarr.Cli/Console/Commands/SonarrCommand.cs index 73198baf..f38cac69 100644 --- a/src/Recyclarr.Cli/Console/Commands/SonarrCommand.cs +++ b/src/Recyclarr.Cli/Console/Commands/SonarrCommand.cs @@ -10,7 +10,6 @@ using Recyclarr.TrashLib.Repo; using Recyclarr.TrashLib.Services.Processors; using Recyclarr.TrashLib.Services.Sonarr; using Serilog; -using Spectre.Console; using Spectre.Console.Cli; namespace Recyclarr.Cli.Console.Commands; @@ -98,37 +97,38 @@ internal class SonarrCommand : AsyncCommand public override async Task ExecuteAsync(CommandContext context, CliSettings settings) { - _log.Warning("The `sonarr` subcommand is DEPRECATED -- Use `sync` instead!"); - // Will throw if migration is required, otherwise just a warning is issued. _migration.CheckNeededMigrations(); await _repoUpdater.UpdateRepo(); if (settings.ListCustomFormats) { + _log.Warning("The `sonarr` subcommand is DEPRECATED -- Use `list custom-formats sonarr` instead!"); _lister.ListCustomFormats(); return 0; } if (settings.ListQualities) { + _log.Warning("The `sonarr` subcommand is DEPRECATED -- Use `list qualities sonarr` instead!"); _lister.ListQualities(); return 0; } if (settings.ListReleaseProfiles) { + _log.Warning("The `sonarr` subcommand is DEPRECATED -- Use `list release-profiles` instead!"); _lister.ListReleaseProfiles(); return 0; } if (settings.ListTerms != "empty") { - // Ignore nullability of ListTerms since the Settings.Validate() method will check for null/empty. _lister.ListTerms(settings.ListTerms!); return 0; } + _log.Warning("The `sonarr` subcommand is DEPRECATED -- Use `sync` instead!"); return (int) await _syncProcessor.ProcessConfigs(settings); } }