forked from darron/sifter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
48 lines (40 loc) · 1.15 KB
/
main.go
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
47
48
package main
import (
"fmt"
"github.com/darron/sifter/commands"
"log"
"log/syslog"
"os"
"runtime"
)
var (
// CompileDate tracks when the binary was compiled. It's inserted during a build
// with build flags. Take a look at the Makefile for information.
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.
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.
Version = "No version provided."
// GoVersion details the version of Go this was compiled with.
GoVersion = runtime.Version()
)
func main() {
logwriter, e := syslog.New(syslog.LOG_NOTICE, "sifter")
if e == nil {
log.SetOutput(logwriter)
}
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()
}