This repository was archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (37 loc) · 1.27 KB
/
main.go
File metadata and controls
46 lines (37 loc) · 1.27 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// +build linux darwin freebsd
package main
import (
"fmt"
"github.com/DataDog/kvexpress/commands"
"log"
"log/syslog"
"os"
"runtime"
)
// CompileDate tracks when the binary was compiled. It's inserted during a build
// with build flags. Take a look at the Makefile for information.
var CompileDate = "No date provided."
// GitCommit tracks the SHA of the built binary. It's inserted during a build
// with build flags. Take a look at the Makefile for information.
var GitCommit = "No revision provided."
// Version is the version of the built binary. It's inserted during a build
// with build flags. Take a look at the Makefile for information.
var Version = "No version provided."
// GoVersion details the version of Go this was compiled with.
var GoVersion = runtime.Version()
func main() {
logwriter, e := syslog.New(syslog.LOG_NOTICE, "kvexpress")
if e == nil {
log.SetFlags(log.Lmicroseconds)
log.SetOutput(logwriter)
}
commands.Log(fmt.Sprintf("kvexpress version:%s", Version), "info")
args := os.Args[1:]
for _, arg := range args {
if arg == "-v" || arg == "--version" {
fmt.Printf("%-8s : %s\n%-8s : %s\n%-8s : %s\n%-8s : %s\n", "Version", Version, "Revision", GitCommit, "Date", CompileDate, "Go", GoVersion)
os.Exit(0)
}
}
commands.RootCmd.Execute()
}