mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
added CSV output mode, enhanced parser tests
This commit is contained in:
@@ -60,6 +60,7 @@ type Modeflag struct {
|
||||
S bool
|
||||
Y bool
|
||||
A bool
|
||||
C bool
|
||||
}
|
||||
|
||||
// used for switching printers
|
||||
@@ -69,6 +70,7 @@ const (
|
||||
Markdown
|
||||
Shell
|
||||
Yaml
|
||||
CSV
|
||||
Ascii
|
||||
)
|
||||
|
||||
@@ -130,6 +132,8 @@ func (conf *Config) PrepareModeFlags(flag Modeflag) {
|
||||
conf.OutputMode = Shell
|
||||
case flag.Y:
|
||||
conf.OutputMode = Yaml
|
||||
case flag.C:
|
||||
conf.OutputMode = CSV
|
||||
default:
|
||||
conf.OutputMode = Ascii
|
||||
}
|
||||
@@ -152,3 +156,10 @@ func (c *Config) CheckEnv() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Config) ApplyDefaults() {
|
||||
// mode specific defaults
|
||||
if c.OutputMode == Yaml || c.OutputMode == CSV {
|
||||
c.NoNumbering = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user