config struct before
This commit is contained in:
@@ -35,6 +35,15 @@ func PrintHelpFormated(version string, author string, buildDate string, cmd *cob
|
||||
fmt.Println("")
|
||||
cmd.Help()
|
||||
fmt.Println("")
|
||||
PrintVersion(version, author, buildDate)
|
||||
|
||||
// color.Yellow.Println(CreateLine(15))
|
||||
// color.Green.Println("| Version: " + version + " || Author: " + author + " || Build date: " + buildDate + " |")
|
||||
// color.Yellow.Println(CreateLine(15))
|
||||
// fmt.Println("")
|
||||
}
|
||||
|
||||
func PrintVersion(version string, author string, buildDate string) {
|
||||
color.Yellow.Println(CreateLine(15))
|
||||
color.Green.Println("| Version: " + version + " || Author: " + author + " || Build date: " + buildDate + " |")
|
||||
color.Yellow.Println(CreateLine(15))
|
||||
@@ -113,3 +122,8 @@ func PadString(s string, n int) string {
|
||||
}
|
||||
return s + strings.Repeat(" ", n-len(s))
|
||||
}
|
||||
|
||||
// function that color in red sub-trings in a string
|
||||
func ColorizeSubStrRed(s string, sub string) string {
|
||||
return strings.Replace(s, sub, color.Red.Sprint(sub), -1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user