mirror of https://github.com/miguelmota/cointop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
459 B
Go
38 lines
459 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/miguelmota/cointop/cointop"
|
|
)
|
|
|
|
var version = "1.0.1"
|
|
|
|
func main() {
|
|
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()
|
|
}
|
|
|
|
func runTest() {
|
|
go func() {
|
|
cointop.Run()
|
|
}()
|
|
time.Sleep(1 * time.Second)
|
|
cointop.Exit()
|
|
}
|