-
Notifications
You must be signed in to change notification settings - Fork 0
/
tt.go
63 lines (54 loc) · 1.39 KB
/
tt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
import (
cli "github.com/Diegiwg/cli"
cmd "github.com/Diegiwg/tt/cmd"
)
func main() {
app := cli.NewApp()
app.AddCommand(&cli.Command{
Name: "start",
Desc: "Starts a new time record",
Help: "Clears the database and starts a new time record.",
Usage: "",
Exec: cmd.Start,
})
app.AddCommand(&cli.Command{
Name: "pause",
Desc: "Adds a pause to the time record",
Help: "When you want to take a break, use this command.",
Usage: "",
Exec: cmd.Pause,
})
app.AddCommand(&cli.Command{
Name: "resume",
Desc: "Resumes counting time after a pause",
Help: "When you want to resume after a pause, use this command.",
Usage: "",
Exec: cmd.Resume,
})
app.AddCommand(&cli.Command{
Name: "stop",
Desc: "Stops time counting, clearing the time record",
Help: "When you want to finish the time record, use this command.",
Usage: "",
Exec: cmd.Stop,
})
app.AddCommand(&cli.Command{
Name: "show",
Desc: "Shows the time passed in the time record",
Help: "When you want to see how much time has passed without finishing the record, use this command.",
Usage: "",
Exec: cmd.Show,
})
app.AddCommand(&cli.Command{
Name: "list",
Desc: "Lists all time records",
Help: "When you want to see all time records, use this command.",
Usage: "[--limit: int]",
Exec: cmd.List,
})
err := app.Run()
if err != nil {
println(err.Error())
}
}