fix: add missing root cmd flags

This commit is contained in:
David Chang 2020-12-05 14:25:19 +08:00
parent b2d9bd0312
commit c72ef2b31c

View File

@ -39,6 +39,9 @@ func init() {
RootCmd.PersistentFlags().String("slack-channel", "dev-bbgo", "slack trading channel")
RootCmd.PersistentFlags().String("slack-error-channel", "bbgo-error", "slack error channel")
RootCmd.PersistentFlags().String("telegram-bot-token", "", "telegram bot token from bot father")
RootCmd.PersistentFlags().String("telegram-init-token", "", "telegram init token")
RootCmd.PersistentFlags().String("binance-api-key", "", "binance api key")
RootCmd.PersistentFlags().String("binance-api-secret", "", "binance api secret")
@ -54,18 +57,18 @@ func Execute() {
// setup the config paths for looking up the config file
/*
viper.AddConfigPath("config")
viper.AddConfigPath("$HOME/.bbgo")
viper.AddConfigPath("/etc/bbgo")
viper.AddConfigPath("config")
viper.AddConfigPath("$HOME/.bbgo")
viper.AddConfigPath("/etc/bbgo")
// set the config file name and format for loading the config file.
viper.SetConfigName("bbgo")
viper.SetConfigType("yaml")
// set the config file name and format for loading the config file.
viper.SetConfigName("bbgo")
viper.SetConfigType("yaml")
err := viper.ReadInConfig()
if err != nil {
log.WithError(err).Fatal("failed to load config file")
}
err := viper.ReadInConfig()
if err != nil {
log.WithError(err).Fatal("failed to load config file")
}
*/
// Once the flags are defined, we can bind config keys with flags.