✨ Parse config overrides on cli
This commit is contained in:
parent
40f9518611
commit
25f5c37243
8 changed files with 169 additions and 32 deletions
|
|
@ -1,8 +1,10 @@
|
|||
package config
|
||||
|
||||
import mapst "github.com/mitchellh/mapstructure"
|
||||
|
||||
type Config struct {
|
||||
Input Input
|
||||
Outputs map[string]Output `toml:"output"`
|
||||
Outputs Outputs `toml:"output"`
|
||||
}
|
||||
|
||||
type Input struct {
|
||||
|
|
@ -11,7 +13,23 @@ type Input struct {
|
|||
Ext string
|
||||
}
|
||||
|
||||
type Outputs map[string]Output
|
||||
|
||||
type Output struct {
|
||||
Enabled bool
|
||||
Config map[string]any
|
||||
}
|
||||
|
||||
func (oo Outputs) Stdout() (s Stdout, enabled bool) {
|
||||
o, ok := oo["stdout"]
|
||||
if !ok {
|
||||
return s, false
|
||||
}
|
||||
enabled = o.Enabled
|
||||
mapst.Decode(o.Config, &s)
|
||||
return
|
||||
}
|
||||
|
||||
type Stdout struct {
|
||||
Json bool
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue