added unit test + docs for the various sort modes.

This commit is contained in:
2022-10-15 19:31:42 +02:00
parent ca87c339b0
commit 9c49b78593
10 changed files with 183 additions and 15 deletions

View File

@@ -174,6 +174,19 @@ func PrepareModeFlags() error {
return nil
}
func PrepareSortFlags() {
switch {
case SortNumeric:
SortMode = "numeric"
case SortAge:
SortMode = "duration"
case SortTime:
SortMode = "time"
default:
SortMode = "string"
}
}
func trimRow(row []string) []string {
// FIXME: remove this when we only use Tablewriter and strip in ParseFile()!
var fixedrow []string