forked from ahelal/ci-bully
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
37 lines (30 loc) · 831 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
36
37
package main
import (
"fmt"
"os"
docopt "github.com/docopt/docopt-go"
)
var runConfig options
var arguments map[string]interface{}
func checkError(msg string, e error) {
if e != nil {
fmt.Printf("%s. %s\n", msg, e.Error())
os.Exit(1)
}
}
func printError(msg string) {
fmt.Printf("%s\n", msg)
os.Exit(1)
}
func main() {
usage := `Usage: ci-bully [-c FILE] [-evhs]
Push for PRs to be merged or closed.
Options:
-c FILE --config=FILE Config the yaml file [default: config.yml].
-e --enable Take action by default it runs in drymode [default: false].
-h --help Show this screen.
-v --version Show version.`
arguments, _ = docopt.Parse(usage, nil, true, "", false)
parseConfig(arguments["--config"].(string))
loopOverRepos()
}