-
Notifications
You must be signed in to change notification settings - Fork 27
/
main.go
33 lines (27 loc) · 853 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
// Package main is the entry point of the go-mod-outdated tool
package main
import (
"flag"
"log"
"os"
"github.com/psampaz/go-mod-outdated/internal/runner"
)
func main() {
withUpdate := flag.Bool("update", false, "List only modules with updates")
onlyDirect := flag.Bool("direct", false, "List only direct modules")
exitNonZero := flag.Bool("ci", false, "Non-zero exit code when at least one outdated dependency was found")
style := flag.String("style", "default", "Output style, pass 'markdown' for a Markdown table")
flag.Parse()
err := runner.Run(os.Stdin, os.Stdout, *withUpdate, *onlyDirect, *exitNonZero, normalizeStyle(*style))
if err != nil {
log.Print(err)
}
}
func normalizeStyle(style string) runner.OutputStyle {
switch style {
case "markdown":
return runner.StyleMarkdown
default:
return runner.StyleDefault
}
}