mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
add version command
This commit is contained in:
parent
6bde66825d
commit
e93b5a1868
|
@ -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
|
||||
}
|
||||
|
|
24
pkg/cmd/version.go
Normal file
24
pkg/cmd/version.go
Normal file
|
@ -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)
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user