diff --git a/Aaru.Localization/UI.Designer.cs b/Aaru.Localization/UI.Designer.cs index 199a0054f..43f381837 100644 --- a/Aaru.Localization/UI.Designer.cs +++ b/Aaru.Localization/UI.Designer.cs @@ -6057,5 +6057,11 @@ namespace Aaru.Localization { return ResourceManager.GetString("List_encodings_command", resourceCulture); } } + + public static string List_namespaces_command { + get { + return ResourceManager.GetString("List_namespaces_command", resourceCulture); + } + } } } diff --git a/Aaru.Localization/UI.resx b/Aaru.Localization/UI.resx index 8d3daabce..d7a03646b 100644 --- a/Aaru.Localization/UI.resx +++ b/Aaru.Localization/UI.resx @@ -3105,4 +3105,7 @@ Do you want to continue? List encodings + + List namespaces + \ No newline at end of file diff --git a/Aaru/Commands/ListNamespaces.cs b/Aaru/Commands/ListNamespaces.cs index a8d363f6c..fd75a0fe1 100644 --- a/Aaru/Commands/ListNamespaces.cs +++ b/Aaru/Commands/ListNamespaces.cs @@ -38,6 +38,7 @@ using Aaru.CommonTypes.Interfaces; using Aaru.Console; using Aaru.Core; using Aaru.Localization; +using Serilog; using Spectre.Console; using Spectre.Console.Cli; @@ -55,22 +56,35 @@ sealed class ListNamespacesCommand : Command AaruConsole.DebugWriteLine(MODULE_NAME, "--verbose={0}", settings.Verbose); Statistics.AddCommand("list-namespaces"); + Log.Information(UI.List_namespaces_command); + PluginRegister plugins = PluginRegister.Singleton; foreach(IReadOnlyFilesystem fs in plugins.ReadOnlyFilesystems.Values) { if(fs?.Namespaces is null) continue; + Log.Information(UI.Namespaces_for_0, fs.Name); + Table table = new() { - Title = new TableTitle(string.Format(UI.Namespaces_for_0, fs.Name)) + Title = new TableTitle(string.Format($"[bold][blue]{UI.Namespaces_for_0}[/][/]", + $"[teal]{Markup.Escape(fs.Name)}[/]")) }; - table.AddColumn(UI.Title_Namespace); - table.AddColumn(UI.Title_Description); + table.Border(TableBorder.Rounded); + table.BorderColor(Color.Yellow); + + table.AddColumn(new TableColumn(new Markup($"[bold][darkgreen]{UI.Title_Namespace}[/][/]").Centered())); + table.AddColumn(new TableColumn(new Markup($"[bold][slateblue1]{UI.Title_Description}[/][/]").Centered())); foreach(KeyValuePair @namespace in fs.Namespaces.OrderBy(t => t.Key)) - table.AddRow(@namespace.Key, @namespace.Value); + { + table.AddRow($"[italic][darkgreen]{Markup.Escape(@namespace.Key)}[/][/]", + $"[italic][slateblue1]{Markup.Escape(@namespace.Value)}[/][/]"); + + Log.Information("({Namespace}) - {Description}", @namespace.Key, @namespace.Value); + } AnsiConsole.Write(table); AaruConsole.WriteLine();