mirror of
https://github.com/hanzoai/bitping-example-client.git
synced 2026-10-30 18:46:57 +00:00
40 lines
671 B
Go
40 lines
671 B
Go
package main
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"os"
|
|
|
|
"github.com/codegangsta/cli"
|
|
cmd "github.com/hanzoai/bitping-example-client/cmd"
|
|
)
|
|
|
|
func main() {
|
|
Run(os.Args)
|
|
}
|
|
|
|
// Run executes the program
|
|
func Run(args []string) {
|
|
app := cli.NewApp()
|
|
var version = readVersion()
|
|
app.Name = "bitping"
|
|
app.Version = version
|
|
app.Usage = "bitpingger"
|
|
app.Flags = []cli.Flag{
|
|
cli.BoolFlag{
|
|
Name: "nocolor",
|
|
Usage: "disable color",
|
|
},
|
|
}
|
|
app.Commands = []cli.Command{cmd.WatchCmd, cmd.DbCmd, cmd.InfoCmd}
|
|
app.Run(args)
|
|
}
|
|
|
|
func readVersion() string {
|
|
var version = "0.0.0"
|
|
da, err := ioutil.ReadFile("./Version")
|
|
if err == nil {
|
|
version = string(da)
|
|
}
|
|
return version
|
|
}
|