Support configuration without config file

This commit is contained in:
Richard Patel
2019-02-03 02:54:52 +01:00
parent 108fff0503
commit 527e8895ec
4 changed files with 109 additions and 29 deletions

View File

@@ -51,8 +51,6 @@ func init() {
rootCmd.AddCommand(&crawlCmd)
rootCmd.AddCommand(&serverCmd)
pf := rootCmd.PersistentFlags()
pf.StringVar(&configFile, "config", "", "Config file")
prepareConfig()
}
@@ -65,9 +63,6 @@ func preRun(cmd *cobra.Command, args []string) error {
readConfig()
if configFile != "" {
viper.SetConfigFile(configFile)
}
return nil
}