-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathmain.go
35 lines (30 loc) · 978 Bytes
/
main.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
package main
import (
"flag"
"log"
"strings"
aw "github.com/deanishe/awgo"
"github.com/deanishe/awgo/update"
"github.com/rkoval/alfred-aws-console-services-workflow/workflow"
)
var wf *aw.Workflow
var forceFetch bool
var query string
var ymlPath string
var openAll bool
func init() {
flag.BoolVar(&forceFetch, "fetch", false, "force fetch via AWS instead of cache")
flag.BoolVar(&openAll, "open_all", false, "open all URLs in a browser for the matching query")
flag.StringVar(&query, "query", "", "query to use")
flag.StringVar(&ymlPath, "yml_path", "console-services.yml", "query to use")
flag.Parse()
wf = aw.New(
update.GitHub("rkoval/alfred-aws-console-services-workflow"), aw.HelpURL("https://github.com/rkoval/alfred-aws-console-services-workflow/issues"))
}
func main() {
wf.Run(func() {
log.Printf("running workflow with query: `%s`", query)
query = strings.TrimLeft(query, " ")
workflow.Run(wf, query, nil, forceFetch, openAll, ymlPath)
})
}