-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
32 lines (26 loc) · 842 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
package main
import (
"os"
"github.com/mateothegreat/github-release-gofer/commands"
"github.com/mateothegreat/go-multilog/multilog"
"github.com/spf13/cobra"
)
var root = &cobra.Command{
Use: "github-gofer",
Short: "GitHub Release Downloading tool.",
Long: "Github Gofer is a CLI tool for downloading GitHub Releases.",
}
func init() {
multilog.RegisterLogger(multilog.LogMethod("console"), multilog.NewConsoleLogger(&multilog.NewConsoleLoggerArgs{
Level: multilog.DEBUG,
Format: multilog.FormatText,
}))
root.CompletionOptions.HiddenDefaultCmd = true
root.PersistentFlags().BoolP("dry-run", "", false, "Dry run the command.")
root.PersistentFlags().StringP("token", "t", os.Getenv("GITHUB_TOKEN"), "GitHub token.")
}
func main() {
root.AddCommand(commands.Upgrade)
root.AddCommand(commands.List)
root.Execute()
}