diff --git a/pkg/cmd/sync.go b/pkg/cmd/sync.go index 13cacd0543..734476f239 100644 --- a/pkg/cmd/sync.go +++ b/pkg/cmd/sync.go @@ -100,10 +100,6 @@ var SyncCmd = &cobra.Command{ sessions := environ.SelectSessions(selectedSessions...) for _, session := range sessions { - if err := session.Init(ctx, environ) ; err != nil { - return err - } - if err := environ.SyncSession(ctx, session, defaultSymbols...); err != nil { return err } diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go new file mode 100644 index 0000000000..5044058c6a --- /dev/null +++ b/pkg/cmd/version.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/c9s/bbgo/pkg/version" +) + +func init() { + // VersionCmd.Flags().String("session", "", "the exchange session name for sync") + RootCmd.AddCommand(VersionCmd) +} + +var VersionCmd = &cobra.Command{ + Use: "version", + Short: "show version name", + SilenceUsage: true, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println(version.Version) + }, +} +