forked from cerc-io/plugeth
Added version flag
This commit is contained in:
parent
60d9611c23
commit
032ab66529
@ -64,6 +64,7 @@ var (
|
|||||||
ImportChain string
|
ImportChain string
|
||||||
SHH bool
|
SHH bool
|
||||||
Dial bool
|
Dial bool
|
||||||
|
PrintVersion bool
|
||||||
)
|
)
|
||||||
|
|
||||||
// flags specific to cli client
|
// flags specific to cli client
|
||||||
@ -120,6 +121,7 @@ func Init() {
|
|||||||
|
|
||||||
flag.BoolVar(&StartMining, "mine", false, "start dagger mining")
|
flag.BoolVar(&StartMining, "mine", false, "start dagger mining")
|
||||||
flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console")
|
flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console")
|
||||||
|
flag.BoolVar(&PrintVersion, "version", false, "prints version number")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
@ -52,6 +52,11 @@ func main() {
|
|||||||
// precedence: code-internal flag default < config file < environment variables < command line
|
// precedence: code-internal flag default < config file < environment variables < command line
|
||||||
Init() // parsing command line
|
Init() // parsing command line
|
||||||
|
|
||||||
|
if PrintVersion {
|
||||||
|
printVersion()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
|
utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
|
||||||
|
|
||||||
ethereum, err := eth.New(ð.Config{
|
ethereum, err := eth.New(ð.Config{
|
||||||
@ -137,3 +142,13 @@ func main() {
|
|||||||
// this blocks the thread
|
// this blocks the thread
|
||||||
ethereum.WaitForShutdown()
|
ethereum.WaitForShutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func printVersion() {
|
||||||
|
fmt.Printf(`%v %v
|
||||||
|
PV=%d
|
||||||
|
GOOS=%s
|
||||||
|
GO=%s
|
||||||
|
GOPATH=%s
|
||||||
|
GOROOT=%s
|
||||||
|
`, ClientIdentifier, Version, eth.ProtocolVersion, runtime.GOOS, runtime.Version(), os.Getenv("GOPATH"), runtime.GOROOT())
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user