diff options
| author | Paul Buetow <paul@buetow.org> | 2021-08-10 12:05:40 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-08-10 12:05:40 +0300 |
| commit | f3e08046badcbc852a6875b5553ee0a648021552 (patch) | |
| tree | fad12e3a3062d3a1f30b910e40a3dde02d87168d /internal/version | |
| parent | 03ec9f8fc1b30d0efb60584c90a027ff5816d153 (diff) | |
can compile with new color codes
Diffstat (limited to 'internal/version')
| -rw-r--r-- | internal/version/version.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/internal/version/version.go b/internal/version/version.go index 7c206b4..a513fdc 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -13,10 +13,10 @@ const ( Name string = "DTail" // Version of DTail. Version string = "3.2.0" - // Additional information for DTail - Additional string = "" // ProtocolCompat -ibility version. ProtocolCompat string = "3" + // Additional information for DTail + Additional string = "Have a lot of fun!" ) // String representation of the DTail version. @@ -29,11 +29,20 @@ func PaintedString() string { if !config.Client.TermColorsEnabled { return String() } - name := color.Paint(color.Yellow, Name) - version := color.Paint(color.Blue, Version) - descr := color.Paint(color.Green, Additional) - return fmt.Sprintf("%s %v Protocol %s %s", name, version, ProtocolCompat, descr) + name := color.PaintWithAttr(Name, + color.FgYellow, color.BgBlue, color.AttrBold) + + version := color.PaintWithAttr(fmt.Sprintf(" %s ", Version), + color.FgBlue, color.BgYellow, color.AttrBold) + + protocol := color.Paint(fmt.Sprintf(" Protocol %s ", ProtocolCompat), + color.FgBlack, color.BgGreen) + + additional := color.PaintWithAttr(fmt.Sprintf(" %s ", Additional), + color.FgWhite, color.BgMagenta, color.AttrBlink) + + return fmt.Sprintf("%s%v%s%s", name, version, protocol, additional) } // PrintAndExit prints the program version and exists. |
