summaryrefslogtreecommitdiff
path: root/version/version.go
blob: 3c3b5e9dd1d7cd5db127ba210c536c885bb6cbc6 (plain)
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
package version

import (
	"dtail/color"
	"fmt"
)

// Name of DTail.
const Name = "DTail"

// Version of DTail.
const Version = "1.0.0"

// Additional information.
const Additional = ""

// String representation of the DTail version.
func String() string {
	return fmt.Sprintf("%s v%v %s", Name, Version, Additional)
}

// PaintedString is a prettier string representation of the DTail version.
func PaintedString() string {
	if !color.Colored {
		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 %s", name, version, descr)
}