From 8f267483a2dd4f3bfa3c5f8dbeb1dc5eb1e145f8 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Mon, 4 Sep 2023 12:12:50 -0500 Subject: [PATCH] feat: Add list command for template includes --- CHANGELOG.md | 3 +++ .../Commands/ConfigListTemplatesCommand.cs | 14 ++++++++++++-- .../Config/ConfigListTemplateProcessor.cs | 15 ++++++++++----- .../Processors/ConfigTemplateListerTest.cs | 6 +++++- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 800c1fd2..505ffb6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Print date & time log at the end of each completed instance sync (#165). - Add status indicator when cloning or updating git repos. - YAML includes are now supported (#175) ([docs][includes]). +- New `--include` option added to `config list templates` to show a list of include templates for + each service type ([docs][listoption]). ### Changed @@ -25,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Error out when duplicate instance names are used. [includes]: https://recyclarr.dev/wiki/yaml/config-reference/include/ +[listoption]: http://recyclarr.dev/wiki/cli/config/list/templates/#include ## [5.3.1] - 2023-08-21 diff --git a/src/Recyclarr.Cli/Console/Commands/ConfigListTemplatesCommand.cs b/src/Recyclarr.Cli/Console/Commands/ConfigListTemplatesCommand.cs index fcfd3f21..97f004eb 100644 --- a/src/Recyclarr.Cli/Console/Commands/ConfigListTemplatesCommand.cs +++ b/src/Recyclarr.Cli/Console/Commands/ConfigListTemplatesCommand.cs @@ -17,8 +17,13 @@ public class ConfigListTemplatesCommand : AsyncCommand data) { - var data = _guideService.GetTemplateData(); - var table = new Table(); var empty = new Markup(""); diff --git a/src/tests/Recyclarr.Cli.Tests/Processors/ConfigTemplateListerTest.cs b/src/tests/Recyclarr.Cli.Tests/Processors/ConfigTemplateListerTest.cs index 17dc4147..25ba3bec 100644 --- a/src/tests/Recyclarr.Cli.Tests/Processors/ConfigTemplateListerTest.cs +++ b/src/tests/Recyclarr.Cli.Tests/Processors/ConfigTemplateListerTest.cs @@ -1,4 +1,5 @@ using System.IO.Abstractions; +using Recyclarr.Cli.Console.Commands; using Recyclarr.Cli.Processors.Config; using Recyclarr.TrashLib.Config; using Recyclarr.TrashLib.Config.Services; @@ -26,7 +27,10 @@ public class ConfigTemplateListerTest : TrashLibIntegrationFixture new TemplatePath {Id = "s2", TemplateFile = stubFile, Service = SupportedServices.Sonarr, Hidden = true} }); - sut.Process(); + var settings = Substitute.For(); + settings.Includes.Returns(false); + + sut.Process(settings); console.Output.Should().NotContain("s2"); }