Skip to content

Commit

Permalink
add version command
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Feb 22, 2021
1 parent 283ec57 commit 0906b37
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
24 changes: 24 additions & 0 deletions pkg/cmd/version.go
Original file line number Diff line number Diff line change
@@ -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)
},
}

0 comments on commit 0906b37

Please sign in to comment.