Improve ascii table, add --ofs flag, enhance documentation (#67)

* enhanced documentation
* added --ofs parameter
  use 2 spaces for ascii output but it is customizable with --ofs,
  which is also being used by CSV mode (whose defaults remains unchanged)
* improve ascii table output, use 2 spaces as OFS by default
This commit is contained in:
T.v.Dein
2025-09-30 11:21:49 +02:00
committed by GitHub
parent 687f4b7bb2
commit 5f3f7c417c
8 changed files with 249 additions and 192 deletions

View File

@@ -280,6 +280,11 @@ func TestPrinter(t *testing.T) {
Numbering: testdata.numberize,
UseColumns: testdata.usecol,
NoColor: true,
OFS: " ",
}
if conf.OutputMode == cfg.CSV {
conf.OFS = ","
}
if testdata.column > 0 {
@@ -304,8 +309,10 @@ func TestPrinter(t *testing.T) {
if got != exp {
t.Errorf("not rendered correctly:\n+++ got:\n%s\n+++ want:\n%s",
strings.ReplaceAll(got, " ", "_"),
strings.ReplaceAll(exp, " ", "_"))
got, exp,
// strings.ReplaceAll(got, " ", "_"),
// strings.ReplaceAll(exp, " ", "_")
)
}
})
}