add -version support in wallet

Signed-off-by: Leo Chen <leo@harmony.one>
pull/160/head
Leo Chen 6 years ago
parent 210fe2b9d8
commit 5e7d003dd8
  1. 15
      client/wallet/main.go
  2. 1
      go_executable_build.sh

@ -27,10 +27,23 @@ import (
"io"
"io/ioutil"
"os"
"path"
"strconv"
"time"
)
var (
version string
builtBy string
builtAt string
commit string
)
func printVersion(me string) {
fmt.Fprintf(os.Stderr, "Harmony (C) 2018. %v, version %v-%v (%v %v)\n", path.Base(me), version, commit, builtBy, builtAt)
os.Exit(0)
}
// AccountState includes the state of an account
type AccountState struct {
balance *big.Int
@ -81,6 +94,8 @@ func main() {
// Switch on the subcommand
switch os.Args[1] {
case "-version":
printVersion(os.Args[0])
case "new":
randomBytes := [32]byte{}
_, err := io.ReadFull(rand.Reader, randomBytes[:])

@ -3,6 +3,7 @@ declare -A SRC
SRC[benchmark]=benchmark.go
SRC[txgen]=client/txgen/main.go
SRC[beacon]=beaconchain/main/main.go
SRC[wallet]=client/wallet/main.go
BINDIR=bin
BUCKET=unique-bucket-bin

Loading…
Cancel
Save