-
Notifications
You must be signed in to change notification settings - Fork 28
/
main.go
46 lines (42 loc) · 1009 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
38
39
40
41
42
43
44
45
46
// Package main is the entrypoint for the gh-token CLI
package main
import (
"fmt"
"os"
"github.com/Link-/gh-token/internal"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
Name: "gh-token",
Usage: "Manage GitHub App installation tokens",
Version: "2.0.2",
EnableBashCompletion: true,
Suggest: true,
Commands: []*cli.Command{
{
Name: "generate",
Usage: "Generate a new GitHub App installation token",
Flags: internal.GenerateFlags(),
Action: internal.Generate,
},
{
Name: "revoke",
Usage: "Revoke a GitHub App installation token",
Flags: internal.RevokeFlags(),
Action: internal.Revoke,
},
{
Name: "installations",
Usage: "List GitHub App installations",
Flags: internal.InstallationsFlags(),
Action: internal.Installations,
},
},
}
err := app.Run(os.Args)
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}