-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
45 lines (36 loc) · 1.17 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
// +build linux darwin freebsd
package main
import (
"./cmd/"
"fmt"
"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, "octo")
if e == nil {
log.SetOutput(logwriter)
}
cmd.Log(fmt.Sprintf("octo version: %s", Version), "info")
args := os.Args[1:]
for _, arg := range args {
if arg == "-v" || arg == "--version" {
fmt.Printf("Version : %s\nRevision : %s\nDate : %s\nGo : %s\n", Version, GitCommit, CompileDate, GoVersion)
os.Exit(0)
}
}
cmd.RootCmd.Execute()
}