Permalink
Browse files

Add -version flag to query version.

Set version to 0.4.0 in anticipation of upcoming release.
Fixes #356

Fixes #368
  • Loading branch information...
jordansissel committed Feb 10, 2015
1 parent 8d48d2e commit c61f261977737937482ad2517292eb4d7b318a34
Showing with 12 additions and 1 deletion.
  1. +8 −1 logstash-forwarder.go
  2. +4 −0 version.go
View
@@ -7,6 +7,7 @@ import (
"os"
"runtime/pprof"
"time"
"fmt"
)
var exitStat = struct {
@@ -26,6 +27,7 @@ var options = &struct {
useSyslog bool
tailOnRotate bool
quiet bool
version bool
}{
spoolSize: 1024,
harvesterBufferSize: 16 << 10,
@@ -76,6 +78,7 @@ func init() {
flag.BoolVar(&options.tailOnRotate, "t", options.tailOnRotate, "always tail on log rotation -note: may skip entries ")
flag.BoolVar(&options.quiet, "quiet", options.quiet, "operate in quiet mode - only emit errors to log")
flag.BoolVar(&options.version, "version", options.version, "output the version of this program")
}
func init() {
@@ -84,7 +87,6 @@ func init() {
func main() {
defer func() {
println("sanity")
p := recover()
if p == nil {
return
@@ -94,6 +96,11 @@ func main() {
flag.Parse()
if options.version {
fmt.Println(Version);
return
}
if options.useSyslog {
configureSyslog()
}
View
@@ -0,0 +1,4 @@
package main
var Version string = "0.4.0"

0 comments on commit c61f261

Please sign in to comment.