From 7e92f0f4e5e44d1525354ef1e533d3a49955251c Mon Sep 17 00:00:00 2001 From: zenix Date: Fri, 11 Mar 2022 19:56:59 +0900 Subject: [PATCH] fix: remove requirements on config flag --- pkg/cmd/account.go | 3 --- pkg/cmd/backtest.go | 3 --- pkg/cmd/cancel.go | 1 - pkg/cmd/orderbook.go | 1 - pkg/cmd/orders.go | 1 - pkg/cmd/run.go | 3 --- pkg/cmd/userdatastream.go | 1 - 7 files changed, 13 deletions(-) diff --git a/pkg/cmd/account.go b/pkg/cmd/account.go index 70ce84cae..41ed9465d 100644 --- a/pkg/cmd/account.go +++ b/pkg/cmd/account.go @@ -24,9 +24,6 @@ var accountCmd = &cobra.Command{ Use: "account [--session SESSION]", Short: "show user account details (ex: balance)", SilenceUsage: true, - PreRunE: cobraInitRequired([]string{ - "config", - }), RunE: func(cmd *cobra.Command, args []string) error { ctx := context.Background() diff --git a/pkg/cmd/backtest.go b/pkg/cmd/backtest.go index e04d6f7ae..439254594 100644 --- a/pkg/cmd/backtest.go +++ b/pkg/cmd/backtest.go @@ -53,9 +53,6 @@ var BacktestCmd = &cobra.Command{ Use: "backtest", Short: "backtest your strategies", SilenceUsage: true, - PreRunE: cobraInitRequired([]string{ - "config", - }), RunE: func(cmd *cobra.Command, args []string) error { verboseCnt, err := cmd.Flags().GetCount("verbose") if err != nil { diff --git a/pkg/cmd/cancel.go b/pkg/cmd/cancel.go index 3daa9ac79..cbab02194 100644 --- a/pkg/cmd/cancel.go +++ b/pkg/cmd/cancel.go @@ -34,7 +34,6 @@ var cancelOrderCmd = &cobra.Command{ // SilenceUsage is an option to silence usage when an error occurs. SilenceUsage: true, - PreRunE: cobraInitRequired([]string{"config"}), RunE: func(cmd *cobra.Command, args []string) error { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/pkg/cmd/orderbook.go b/pkg/cmd/orderbook.go index bd1ca36ba..bfe932344 100644 --- a/pkg/cmd/orderbook.go +++ b/pkg/cmd/orderbook.go @@ -19,7 +19,6 @@ var orderbookCmd = &cobra.Command{ Use: "orderbook --session=[exchange_name] --symbol=[pair_name]", Short: "connect to the order book market data streaming service of an exchange", PreRunE: cobraInitRequired([]string{ - "config", "session", "symbol", }), diff --git a/pkg/cmd/orders.go b/pkg/cmd/orders.go index 2f6dcc493..ea0b34462 100644 --- a/pkg/cmd/orders.go +++ b/pkg/cmd/orders.go @@ -24,7 +24,6 @@ var getOrderCmd = &cobra.Command{ Short: "Get order status", SilenceUsage: true, PreRunE: cobraInitRequired([]string{ - "config", "order-id", "symbol", }), diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index d69f062d4..812841cd3 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -40,9 +40,6 @@ var RunCmd = &cobra.Command{ // SilenceUsage is an option to silence usage when an error occurs. SilenceUsage: true, - PreRunE: cobraInitRequired([]string{ - "config", - }), RunE: run, } diff --git a/pkg/cmd/userdatastream.go b/pkg/cmd/userdatastream.go index 9426e5a2c..b53a1a631 100644 --- a/pkg/cmd/userdatastream.go +++ b/pkg/cmd/userdatastream.go @@ -19,7 +19,6 @@ var userDataStreamCmd = &cobra.Command{ Use: "userdatastream", Short: "Listen to session events (orderUpdate, tradeUpdate, balanceUpdate, balanceSnapshot)", PreRunE: cobraInitRequired([]string{ - "config", "session", }), RunE: func(cmd *cobra.Command, args []string) error {