-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.go
More file actions
38 lines (32 loc) · 966 Bytes
/
Copy pathversion.go
File metadata and controls
38 lines (32 loc) · 966 Bytes
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
package main
import (
"fmt"
"os"
"github.com/fatih/color"
)
var (
version string
buildDate string
commit string
)
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(version))
fmt.Println("version: ", bold(buildDate))
fmt.Println("commit: ", bold(commit))
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)
}
}