gotime-lib/cmd/gotime-cui/main.go

39 lines
640 B
Go
Raw Normal View History

2017-01-11 23:45:04 +00:00
package main
import (
"fmt"
"os"
"gogs.bullercodeworks.com/brian/gotime"
)
func main() {
var dir string
/*
err := termbox.Init()
if err != nil {
panic(err)
}
defer termbox.Close()
*/
if len(os.Args) > 1 {
dir = os.Args[1]
}
got := gotime.Create(dir)
t := got.GetAllTimers()
for i := range t {
fmt.Println(t[i].ToJsonString())
}
fmt.Println("=== Start Timer ===")
ts := gotime.CreateStartTimerTxns(&t[len(t)-1])
for i := range ts {
fmt.Println(ts[i].ToString())
}
fmt.Println("=== Stop Timer ===")
ts = gotime.CreateStopTimerTxns(&t[len(t)-1])
for i := range ts {
fmt.Println(ts[i].ToString())
}
}