-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion.go
34 lines (28 loc) · 967 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
package main
import (
"fmt"
"os"
"github.com/fatih/color"
)
const Version string = "0.3.0"
const BuildDate string = "2024-10-17"
func cliCommandDisplayHelp(args []string) {
displayVersion := StringInSlice("-v", args[1:]) || StringInSlice("--version", args[1:])
if displayVersion {
bold := color.New(color.Bold).SprintFunc()
italic := color.New(color.Italic).SprintFunc()
fmt.Println()
fmt.Println(bold("⚡️ Git branch"))
fmt.Println()
fmt.Println("build date: ", bold(BuildDate))
fmt.Println("version: ", bold(Version))
fmt.Println()
fmt.Println("-v / --version : display this help menu")
fmt.Println("-d / --delete : enters the delete mode")
// fmt.Println("-c / --count <int>: how many branches to display. Cares about GIT_BRANCH_COUNT")
fmt.Println()
fmt.Println(italic("Need help?"))
fmt.Println(italic("https://github.com/Tchoupinax/git-branch/issues"))
os.Exit(0)
}
}