diff options
| author | Paul Bütow <pbuetow@mimecast.com> | 2020-01-09 20:30:15 +0000 |
|---|---|---|
| committer | Paul Bütow <pbuetow@mimecast.com> | 2020-01-09 20:30:15 +0000 |
| commit | 3755a9911ecb05886577095f2b8cc8b9e4066a3a (patch) | |
| tree | 86e24bc466986cb5c9c6d167a918e6064defeafc /version/version.go | |
Release of DTail v1.0.0v1.0.0
Diffstat (limited to 'version/version.go')
| -rw-r--r-- | version/version.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/version/version.go b/version/version.go new file mode 100644 index 0000000..3c3b5e9 --- /dev/null +++ b/version/version.go @@ -0,0 +1,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) +} |
