mirror of
https://github.com/terorie/od-database-crawler.git
synced 2025-12-18 01:09:03 +00:00
Support configuration without config file
This commit is contained in:
5
main.go
5
main.go
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user