|
2 | 2 | using Spectre.Console.Cli; |
3 | 3 | using System.ComponentModel; |
4 | 4 | using System.Linq; |
| 5 | +using TinyCity.BookmarkEngines; |
| 6 | +using TinyCity.Model; |
5 | 7 |
|
6 | 8 | namespace TinyCity.Commands |
7 | 9 | { |
@@ -32,9 +34,12 @@ public class ConfigCommandSettings : CommandSettings |
32 | 34 | public class ConfigCommand : Command<ConfigCommandSettings> |
33 | 35 | { |
34 | 36 | private readonly TinyCitySettings _tinyCitySettings; |
35 | | - public ConfigCommand(TinyCitySettings settings) |
| 37 | + private readonly BookmarkAggregator _bookmarkAggregator; |
| 38 | + |
| 39 | + public ConfigCommand(TinyCitySettings settings, BookmarkAggregator bookmarkAggregator) |
36 | 40 | { |
37 | 41 | _tinyCitySettings = settings; |
| 42 | + _bookmarkAggregator = bookmarkAggregator; |
38 | 43 | } |
39 | 44 |
|
40 | 45 | public override int Execute(CommandContext context, ConfigCommandSettings settings) |
@@ -65,14 +70,27 @@ public override int Execute(CommandContext context, ConfigCommandSettings settin |
65 | 70 |
|
66 | 71 | private void ShowConfiguration() |
67 | 72 | { |
68 | | - AnsiConsole.MarkupLine($"[bold green]Loaded config file from: {TinyCitySettings.GetConfigFilePath()}[/]"); |
69 | | - AnsiConsole.MarkupLine($"[green]- Home Directory: {_tinyCitySettings.ApplicationConfigDirectory}[/]"); |
70 | | - AnsiConsole.MarkupLine($"[green]- Browser path: {_tinyCitySettings.BrowserPath}[/]"); |
71 | | - AnsiConsole.MarkupLine($"[green]- HTML bookmarkpath: {_tinyCitySettings.HtmlBookmarksFile}[/]"); |
72 | | - AnsiConsole.MarkupLine($"[green]- Markdown Files:[/]"); |
73 | | - foreach (var file in _tinyCitySettings.MarkdownFiles) |
| 73 | + AnsiConsole.MarkupLine($"[deepskyblue1]Bookmark sources ({_bookmarkAggregator.AllBookmarks.Count} unique bookmarks in total):[/]"); |
| 74 | + _bookmarkAggregator.WriteLoadedLog(); |
| 75 | + |
| 76 | + AnsiConsole.MarkupLine($"[deepskyblue1]Configuration ('{TinyCitySettings.GetConfigFilePath()}'):[/]"); |
| 77 | + AnsiConsole.MarkupLine($" - Home Directory: {_tinyCitySettings.ApplicationConfigDirectory}."); |
| 78 | + AnsiConsole.MarkupLine($" - Browser path: {_tinyCitySettings.BrowserPath}."); |
| 79 | + |
| 80 | + string htmlFilePath = _tinyCitySettings.HtmlBookmarksFile ?? "(none)"; |
| 81 | + AnsiConsole.MarkupLine($" - HTML bookmarkpath: {htmlFilePath}."); |
| 82 | + |
| 83 | + if (_tinyCitySettings.MarkdownFiles.Count > 0) |
| 84 | + { |
| 85 | + AnsiConsole.MarkupLine($" - Markdown Files:"); |
| 86 | + foreach (var file in _tinyCitySettings.MarkdownFiles) |
| 87 | + { |
| 88 | + AnsiConsole.MarkupLine($" - {file}"); |
| 89 | + } |
| 90 | + } |
| 91 | + else |
74 | 92 | { |
75 | | - AnsiConsole.MarkupLine($" - {file}"); |
| 93 | + AnsiConsole.MarkupLine($" - Markdown Files: (none)"); |
76 | 94 | } |
77 | 95 | } |
78 | 96 |
|
|
0 commit comments