equal
deleted
inserted
replaced
8 import ( |
8 import ( |
9 "fmt" |
9 "fmt" |
10 "io/ioutil" |
10 "io/ioutil" |
11 "os" |
11 "os" |
12 |
12 |
|
13 "github.com/pkg/errors" |
13 "github.com/spf13/cobra" |
14 "github.com/spf13/cobra" |
14 "github.com/spf13/viper" |
15 "github.com/spf13/viper" |
15 |
16 |
16 "github.com/McKael/madon" |
17 "github.com/McKael/madon" |
17 "github.com/McKael/madonctl/printer" |
18 "github.com/McKael/madonctl/printer" |
144 of := viper.GetString("output") |
145 of := viper.GetString("output") |
145 switch of { |
146 switch of { |
146 case "", "plain", "json", "yaml", "template": |
147 case "", "plain", "json", "yaml", "template": |
147 return nil // Accepted |
148 return nil // Accepted |
148 } |
149 } |
149 return fmt.Errorf("output format '%s' not supported", of) |
150 return errors.Errorf("output format '%s' not supported", of) |
150 } |
151 } |
151 |
152 |
152 // initConfig reads in config file and ENV variables if set. |
153 // initConfig reads in config file and ENV variables if set. |
153 func initConfig() { |
154 func initConfig() { |
154 if cfgFile != "" { // enable ability to specify config file via flag |
155 if cfgFile != "" { // enable ability to specify config file via flag |