-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
48 lines (40 loc) · 844 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
47
48
package main
import (
"fmt"
"log"
"gitlab.sportradar.ag/ads/adsstaff/gogen/cmd"
"github.com/spf13/cobra"
)
var (
version = "dev"
commit = "nil"
date = "nil"
builtBy = "dev"
)
func main() {
cmdRepo, err := cmd.GetRepoCmd(version)
if err != nil {
log.Fatal(err)
}
cmdService, err := cmd.GetServiceCmd()
if err != nil {
log.Fatal(err)
}
cmdVersion := &cobra.Command{
Use: "version",
Aliases: []string{"v"},
Short: "",
Long: "",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("version: %s\n", version)
fmt.Printf("commit: %s\n", commit)
fmt.Printf("date: %s\n", date)
fmt.Printf("builtBy: %s\n", builtBy)
},
}
var rootCmd = &cobra.Command{Use: "gogen"}
rootCmd.AddCommand(cmdRepo, cmdService, cmdVersion)
if err := rootCmd.Execute(); err != nil {
log.Fatal(err)
}
}