-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.go
61 lines (52 loc) · 1.04 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
60
61
package main
import (
"fmt"
"log"
"os"
"github.com/urfave/cli/v2"
rp "github.com/avarabyeu/goRP/v5/cli"
)
var (
version = ""
buildDate = ""
)
func main() {
log.SetFlags(0)
log.SetOutput(os.Stdout)
app := cli.NewApp()
app.Name = "goRP"
app.Usage = "ReportPortal CLI Client"
app.Version = fmt.Sprintf("%s (%s)", version, buildDate)
app.Authors = []*cli.Author{{
Name: "Andrei Varabyeu",
Email: "[email protected]",
}}
app.Flags = []cli.Flag{
&cli.StringFlag{
Name: "uuid",
Aliases: []string{"u"},
Usage: "Access Token",
EnvVars: []string{"GORP_UUID"},
},
&cli.StringFlag{
Name: "project",
Aliases: []string{"p"},
Usage: "ReportPortal Project Name",
EnvVars: []string{"GORP_PROJECT"},
},
&cli.StringFlag{
Name: "host",
Usage: "ReportPortal Server Name",
},
}
app.Commands = rp.RootCommand
defer func() {
if r := recover(); r != nil {
log.Fatalf("error: %v", r)
}
}()
if err := app.Run(os.Args); err != nil {
//nolint:gocritic
log.Fatal(err.Error())
}
}