Stop when help action is called

This commit is contained in:
Glenn Y. Rolland 2018-12-27 13:35:57 +01:00
parent 718ab5073e
commit 7d00226118

View file

@ -87,6 +87,11 @@ func (self *Config) Parse() error {
os.Exit(1) os.Exit(1)
} }
showHelp, _ := self.Parser.Flags().GetBool("help")
if showHelp {
os.Exit(0)
}
if err := viper.Unmarshal(&self); err != nil { if err := viper.Unmarshal(&self); err != nil {
panic("Unable to unmarshal config") panic("Unable to unmarshal config")
} }