-
Notifications
You must be signed in to change notification settings - Fork 25
/
asana.go
101 lines (95 loc) · 1.91 KB
/
asana.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package main
import (
"os"
"github.com/urfave/cli/v2"
"github.com/thash/asana/commands"
)
func main() {
app := cli.NewApp()
app.Name = "asana"
app.Version = "0.2.1"
app.Usage = "asana cui client ( https://github.com/thash/asana )"
app.Commands = defs()
app.Run(os.Args)
}
func defs() []*cli.Command {
return []*cli.Command{
{
Name: "config",
Aliases: []string{"c"},
Usage: "Asana configuration. Your settings will be saved in ~/.asana.yml",
Action: func(c *cli.Context) error {
commands.Config(c)
return nil
},
},
{
Name: "workspaces",
Aliases: []string{"w"},
Usage: "get workspaces",
Action: func(c *cli.Context) error {
commands.Workspaces(c)
return nil
},
},
{
Name: "tasks",
Aliases: []string{"ts"},
Usage: "get tasks",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "no-cache, n", Usage: "without cache"},
&cli.BoolFlag{Name: "refresh, r", Usage: "update cache"},
},
Action: func(c *cli.Context) error {
commands.Tasks(c)
return nil
},
},
{
Name: "task",
Aliases: []string{"t"},
Usage: "get a task",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "verbose, v", Usage: "verbose output"},
},
Action: func(c *cli.Context) error {
commands.Task(c)
return nil
},
},
{
Name: "comment",
Aliases: []string{"cm"},
Usage: "Post comment",
Action: func(c *cli.Context) error {
commands.Comment(c)
return nil
},
},
{
Name: "done",
Usage: "Complete task",
Action: func(c *cli.Context) error {
commands.Done(c)
return nil
},
},
{
Name: "due",
Usage: "set due date",
Action: func(c *cli.Context) error {
commands.DueOn(c)
return nil
},
},
{
Name: "browse",
Aliases: []string{"b"},
Usage: "open a task in the web browser",
Action: func(c *cli.Context) error {
commands.Browse(c)
return nil
},
},
}
}