Merge pull request #473 from zenixls2/fix/no_config_flag

fix: remove requirements on config flag
This commit is contained in:
Yo-An Lin 2022-03-11 21:28:30 +08:00 committed by GitHub
commit a6a4eb94f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 0 additions and 13 deletions

View File

@ -24,9 +24,6 @@ var accountCmd = &cobra.Command{
Use: "account [--session SESSION]", Use: "account [--session SESSION]",
Short: "show user account details (ex: balance)", Short: "show user account details (ex: balance)",
SilenceUsage: true, SilenceUsage: true,
PreRunE: cobraInitRequired([]string{
"config",
}),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background() ctx := context.Background()

View File

@ -53,9 +53,6 @@ var BacktestCmd = &cobra.Command{
Use: "backtest", Use: "backtest",
Short: "backtest your strategies", Short: "backtest your strategies",
SilenceUsage: true, SilenceUsage: true,
PreRunE: cobraInitRequired([]string{
"config",
}),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
verboseCnt, err := cmd.Flags().GetCount("verbose") verboseCnt, err := cmd.Flags().GetCount("verbose")
if err != nil { if err != nil {

View File

@ -34,7 +34,6 @@ var cancelOrderCmd = &cobra.Command{
// SilenceUsage is an option to silence usage when an error occurs. // SilenceUsage is an option to silence usage when an error occurs.
SilenceUsage: true, SilenceUsage: true,
PreRunE: cobraInitRequired([]string{"config"}),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()

View File

@ -19,7 +19,6 @@ var orderbookCmd = &cobra.Command{
Use: "orderbook --session=[exchange_name] --symbol=[pair_name]", Use: "orderbook --session=[exchange_name] --symbol=[pair_name]",
Short: "connect to the order book market data streaming service of an exchange", Short: "connect to the order book market data streaming service of an exchange",
PreRunE: cobraInitRequired([]string{ PreRunE: cobraInitRequired([]string{
"config",
"session", "session",
"symbol", "symbol",
}), }),

View File

@ -24,7 +24,6 @@ var getOrderCmd = &cobra.Command{
Short: "Get order status", Short: "Get order status",
SilenceUsage: true, SilenceUsage: true,
PreRunE: cobraInitRequired([]string{ PreRunE: cobraInitRequired([]string{
"config",
"order-id", "order-id",
"symbol", "symbol",
}), }),

View File

@ -40,9 +40,6 @@ var RunCmd = &cobra.Command{
// SilenceUsage is an option to silence usage when an error occurs. // SilenceUsage is an option to silence usage when an error occurs.
SilenceUsage: true, SilenceUsage: true,
PreRunE: cobraInitRequired([]string{
"config",
}),
RunE: run, RunE: run,
} }

View File

@ -19,7 +19,6 @@ var userDataStreamCmd = &cobra.Command{
Use: "userdatastream", Use: "userdatastream",
Short: "Listen to session events (orderUpdate, tradeUpdate, balanceUpdate, balanceSnapshot)", Short: "Listen to session events (orderUpdate, tradeUpdate, balanceUpdate, balanceSnapshot)",
PreRunE: cobraInitRequired([]string{ PreRunE: cobraInitRequired([]string{
"config",
"session", "session",
}), }),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {