You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
906 B
39 lines
906 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path"
|
|
|
|
cmd "github.com/woop-chain/go-sdk/cmd/subcommands"
|
|
// Need this side effect
|
|
"github.com/spf13/cobra"
|
|
_ "github.com/woop-chain/go-sdk/pkg/store"
|
|
)
|
|
|
|
var (
|
|
version string
|
|
commit string
|
|
builtAt string
|
|
builtBy string
|
|
)
|
|
|
|
func main() {
|
|
// HACK Force usage of go implementation rather than the C based one. Do the right way, see the
|
|
// notes one line 66,67 of https://golang.org/src/net/net.go that say can make the decision at
|
|
// build time.
|
|
os.Setenv("GODEBUG", "netdns=go")
|
|
cmd.VersionWrapDump = version + "-" + commit
|
|
cmd.RootCmd.AddCommand(&cobra.Command{
|
|
Use: "version",
|
|
Short: "Show version",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
fmt.Fprintf(os.Stderr,
|
|
"Woop (C) 2024. %v, version %v-%v (%v %v)\n",
|
|
path.Base(os.Args[0]), version, commit, builtBy, builtAt)
|
|
os.Exit(0)
|
|
return nil
|
|
},
|
|
})
|
|
cmd.Execute()
|
|
}
|
|
|