add -k<name> and sort by multiple columns support, fixes #34

This commit is contained in:
2025-01-15 18:51:15 +01:00
committed by T.v.Dein
parent c2e7d8037a
commit 63c7ef26b6
13 changed files with 131 additions and 57 deletions

View File

@@ -33,15 +33,17 @@ import (
)
func printData(writer io.Writer, conf cfg.Config, data *Tabdata) {
// add numbers to headers and remove this we're not interested in
// Sort the data first, before headers+entries are being
// reduced. That way the user can specify any valid column to sort
// by, independently if it's being used for display or not.
sortTable(conf, data)
// add numbers to headers and remove those we're not interested in
numberizeAndReduceHeaders(conf, data)
// remove unwanted columns, if any
reduceColumns(conf, data)
// sort the data
sortTable(conf, data)
switch conf.OutputMode {
case cfg.Extended:
printExtendedData(writer, conf, data)