-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
49 lines (42 loc) · 975 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
49
package main
import (
"fmt"
"os"
"runtime"
"github.com/mrjosh/udp2grpc/cmds"
"github.com/mrjosh/udp2grpc/internal/version"
"github.com/spf13/cobra"
)
var (
BranchName string
Version string
CompiledBy string
BuildTime string
)
func main() {
rootCmd := &cobra.Command{
Use: "utg",
Long: `
__ ______ ____ ___ ____ ____ ______
/ / / / __ \/ __ \__ \ ____ / __ \/ __ \/ ____/
/ / / / / / / /_/ /_/ // __ \/ /_/ / /_/ / /
/ /_/ / /_/ / ____/ __// /_/ / _, _/ ____/ /___
\____/_____/_/ /____/\__, /_/ |_/_/ \____/
/____/`,
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}
rootCmd.SetArgs(os.Args[1:])
vi := &version.BuildInfo{
Version: Version,
Branch: BranchName,
CompiledBy: CompiledBy,
GoVersion: runtime.Version(),
BuildTime: BuildTime,
}
if err := cmds.Start(vi, rootCmd); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}