|
@@ -31,14 +31,19 @@ type IRCCat struct {
|
31
|
31
|
|
32
|
32
|
func main() {
|
33
|
33
|
debug := flag.Bool("debug", false, "Print raw IRC lines")
|
|
34
|
+ configFile := flag.String("config", "", "Path to config file to use")
|
34
|
35
|
flag.Parse()
|
35
|
36
|
|
36
|
37
|
loggo.ConfigureLoggers("<root>=INFO")
|
37
|
38
|
log.Infof("IRCCat %s (%s) starting...", branch, revision)
|
38
|
|
- viper.SetConfigName("irccat")
|
39
|
|
- viper.AddConfigPath("/run/secrets")
|
40
|
|
- viper.AddConfigPath("/etc")
|
41
|
|
- viper.AddConfigPath(".")
|
|
39
|
+ if *configFile != "" {
|
|
40
|
+ viper.SetConfigFile(*configFile)
|
|
41
|
+ } else {
|
|
42
|
+ viper.SetConfigName("irccat")
|
|
43
|
+ viper.AddConfigPath("/run/secrets")
|
|
44
|
+ viper.AddConfigPath("/etc")
|
|
45
|
+ viper.AddConfigPath(".")
|
|
46
|
+ }
|
42
|
47
|
var err error
|
43
|
48
|
|
44
|
49
|
err = viper.ReadInConfig()
|