config struct before

This commit is contained in:
2023-06-25 12:54:50 -04:00
parent 1895ade98e
commit 7c24456629
8 changed files with 210 additions and 78 deletions
+14
View File
@@ -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)
}