diff --git a/src/MfGames.ToolBuilder/Tables/TableFormatType.cs b/src/MfGames.ToolBuilder/Tables/TableFormatType.cs index 9afd828..2f0de46 100644 --- a/src/MfGames.ToolBuilder/Tables/TableFormatType.cs +++ b/src/MfGames.ToolBuilder/Tables/TableFormatType.cs @@ -41,10 +41,5 @@ namespace MfGames.ToolBuilder.Tables /// Indicates tht the output should be written as comma-separated values. /// Csv, - - /// - /// Duplicates ConsoleTableBuilderFormat.Default. - /// - Full = Default, } } diff --git a/src/MfGames.ToolBuilder/Tables/TableToolService.cs b/src/MfGames.ToolBuilder/Tables/TableToolService.cs index 52dd2a4..b545162 100644 --- a/src/MfGames.ToolBuilder/Tables/TableToolService.cs +++ b/src/MfGames.ToolBuilder/Tables/TableToolService.cs @@ -104,7 +104,7 @@ namespace MfGames.ToolBuilder.Tables this.tableFormatOption = new Option( "--table-format", - () => nameof(TableFormatType.Minimal), + () => nameof(TableFormatType.Default), tableFormatDescription) { ArgumentHelpName = "format", @@ -402,9 +402,31 @@ namespace MfGames.ToolBuilder.Tables TableFormatType tableFormat) { // Build the table from options. - ConsoleTableBuilder builder = ConsoleTableBuilder - .From(this.table) - .WithFormat((ConsoleTableBuilderFormat)tableFormat); + ConsoleTableBuilder builder = ConsoleTableBuilder.From(this.table); + + // Figure out formatting. + if (tableFormat == TableFormatType.Default) + { + // Default is mostly like ConsoleTableExt but there is a separator + // between the headers because it makes it harder to parse. + builder + .WithCharMapDefinition( + new Dictionary + { + { CharMapPositions.DividerY, ' ' }, + }) + .WithHeaderCharMapDefinition( + new Dictionary + { + { HeaderCharMapPositions.BottomCenter, '+' }, + { HeaderCharMapPositions.Divider, ' ' }, + { HeaderCharMapPositions.BorderBottom, '-' }, + }); + } + else + { + builder.WithFormat((ConsoleTableBuilderFormat)tableFormat); + } // We default to aligning numerical columns to the right. bool noAlign =