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-channel", "dev-bbgo", "slack trading channel")
RootCmd.PersistentFlags().String("slack-error-channel", "bbgo-error", "slack error 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-key", "", "binance api key")
RootCmd.PersistentFlags().String("binance-api-secret", "", "binance api secret") 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 // setup the config paths for looking up the config file
/* /*
viper.AddConfigPath("config") viper.AddConfigPath("config")
viper.AddConfigPath("$HOME/.bbgo") viper.AddConfigPath("$HOME/.bbgo")
viper.AddConfigPath("/etc/bbgo") viper.AddConfigPath("/etc/bbgo")
// set the config file name and format for loading the config file. // set the config file name and format for loading the config file.
viper.SetConfigName("bbgo") viper.SetConfigName("bbgo")
viper.SetConfigType("yaml") viper.SetConfigType("yaml")
err := viper.ReadInConfig() err := viper.ReadInConfig()
if err != nil { if err != nil {
log.WithError(err).Fatal("failed to load config file") log.WithError(err).Fatal("failed to load config file")
} }
*/ */
// Once the flags are defined, we can bind config keys with flags. // Once the flags are defined, we can bind config keys with flags.