add support for template output mode with new option --templage <tmpl> (#47)

This commit is contained in:
T. von Dein
2025-12-08 22:01:15 +01:00
parent 2bb0cdb0af
commit fc0352efa9
11 changed files with 216 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
}