add template output mode

This commit is contained in:
2025-12-08 21:53:44 +01:00
parent 2bb0cdb0af
commit db35d08385
11 changed files with 214 additions and 48 deletions

View File

@@ -28,7 +28,7 @@ import (
)
const (
Version = "v1.5.11"
Version = "v1.5.12"
MAXPARTS = 2
)
@@ -95,6 +95,7 @@ type Config struct {
InputJSON bool
AutoHeaders bool
CustomHeaders []string
Template string
SortMode string
SortDescending bool
@@ -142,6 +143,7 @@ type Modeflag struct {
A bool
C bool
J bool
P bool // template
}
// used for switching printers
@@ -154,6 +156,7 @@ const (
CSV
ASCII
Json
Template
)
// various sort types
@@ -294,6 +297,8 @@ func (conf *Config) PrepareModeFlags(flag Modeflag) {
conf.OutputMode = CSV
case flag.J:
conf.OutputMode = Json
case conf.Template != "":
conf.OutputMode = Template
default:
conf.OutputMode = ASCII
}