mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-24 15:55:14 +00:00
fix: remove requirements on config flag
This commit is contained in:
parent
522b84c6aa
commit
7e92f0f4e5
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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",
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -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",
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user