-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion.go
35 lines (29 loc) · 825 Bytes
/
version.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
package main
import (
"fmt"
"os"
utils "github.com/Tchoupinax/k8s-labels-migrator/utils"
"github.com/fatih/color"
)
var (
version string
buildDate string
commit string
)
func cliCommandDisplayHelp(args []string) {
displayVersion := utils.StringInSlice("-v", args[1:]) || utils.StringInSlice("--version", args[1:])
if displayVersion {
bold := color.New(color.Bold).SprintFunc()
italic := color.New(color.Italic).SprintFunc()
fmt.Println()
fmt.Println(bold("⚡️ Kubernetes labels migrator"))
fmt.Println()
fmt.Println("build date: ", bold(buildDate))
fmt.Println("version: ", bold(version))
fmt.Println("commit: ", bold(commit))
fmt.Println()
fmt.Println(italic("Need help?"))
fmt.Println(italic("https://github.com/Tchoupinax/k8s-labels-migrator/issues"))
os.Exit(0)
}
}