-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
59 lines (52 loc) · 1.18 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"os"
"github.com/pPrecel/PKUP/cmd"
"github.com/pterm/pterm"
"github.com/urfave/cli/v2"
)
var (
version = "local"
commit = "local"
date = "local"
buildOs = "local"
buildArch = "local"
projectOwner = "pPrecel"
projectRepo = "pkup-gen"
pkupClientID = ""
)
func main() {
log := pterm.DefaultLogger.
WithTime(false)
opts := &cmd.Options{
BuildVersion: version,
BuildCommit: commit,
BuildDate: date,
BuildOs: buildOs,
BuildArch: buildArch,
ProjectOwner: projectOwner,
ProjectRepo: projectRepo,
PkupClientID: pkupClientID,
Log: log,
}
app := &cli.App{
Name: "pkup",
Usage: "Easly generate .diff files with all users merged content in the last PKUP period",
UsageText: "pkup gen \\\n" +
"\t\t--username <username> \\\n" +
"\t\t--repo <org1>/<repo1> \\\n" +
"\t\t--repo <org2>/<repo2>",
Flags: []cli.Flag{
cli.HelpFlag,
},
Commands: []*cli.Command{
cmd.NewGenCommand(opts),
cmd.NewComposeCommand(opts),
cmd.NewVersionCommand(opts),
cmd.NewSendCommand(opts),
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal("program error", log.Args("error", err))
}
}