refactor: Do not use "empty" for SonarrCommand terms

pull/201/head
Robert Dailey 2 years ago
parent 7cdd94e626
commit 806a0fa64f

@ -67,18 +67,7 @@ internal class SonarrCommand : AsyncCommand<SonarrCommand.CliSettings>
[Description( [Description(
"For the given Release Profile Trash ID, list terms in it that can be filtered in YAML format. " + "For the given Release Profile Trash ID, list terms in it that can be filtered in YAML format. " +
"Note that not every release profile has terms that may be filtered.")] "Note that not every release profile has terms that may be filtered.")]
public string? ListTerms { get; init; } = "empty"; public string? ListTerms { get; init; }
public override ValidationResult Validate()
{
if (string.IsNullOrEmpty(ListTerms))
{
return ValidationResult.Error(
"The --list-terms option was specified without a Release Profile Trash ID specified");
}
return base.Validate();
}
} }
public SonarrCommand( public SonarrCommand(
@ -122,9 +111,9 @@ internal class SonarrCommand : AsyncCommand<SonarrCommand.CliSettings>
return 0; return 0;
} }
if (settings.ListTerms != "empty") if (settings.ListTerms is not null)
{ {
_lister.ListTerms(settings.ListTerms!); _lister.ListTerms(settings.ListTerms);
return 0; return 0;
} }

Loading…
Cancel
Save