2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-10 13:10:26 +00:00
cointop/main.go

38 lines
459 B
Go
Raw Normal View History

package main
import (
2018-04-28 00:07:13 +00:00
"flag"
"fmt"
2018-04-28 20:10:17 +00:00
"time"
2018-04-28 00:07:13 +00:00
"github.com/miguelmota/cointop/cointop"
)
2018-04-28 20:10:17 +00:00
var version = "1.0.1"
2018-04-28 00:07:13 +00:00
func main() {
2018-04-28 00:07:13 +00:00
var ver bool
flag.BoolVar(&ver, "v", false, "Version")
var test bool
flag.BoolVar(&test, "test", false, "Run test")
flag.Parse()
if ver {
fmt.Println(version)
return
}
if test {
runTest()
return
}
cointop.Run()
}
2018-04-28 00:07:13 +00:00
func runTest() {
2018-04-28 20:10:17 +00:00
go func() {
cointop.Run()
}()
time.Sleep(1 * time.Second)
cointop.Exit()
2018-04-28 00:07:13 +00:00
}