2018-03-31 08:59:20 +00:00
|
|
|
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
|
|
|
|
2018-03-31 08:59:20 +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
|
|
|
|
2018-03-31 08:59:20 +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
|
|
|
|
}
|
|
|
|
|
2018-03-31 08:59:20 +00:00
|
|
|
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
|
|
|
}
|