Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
add ./logsend -version command
Browse files Browse the repository at this point in the history
  • Loading branch information
ezotrank committed Jan 7, 2015
1 parent 5d6540f commit 7acdc85
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
"os"
)

const (
VERSION = "1.7.1"
)

var (
watchDir = flag.String("watch-dir", "", "deprecated, simply add the directory as an argument, in the end")
config = flag.String("config", "", "path to config.json file")
Expand All @@ -21,11 +25,17 @@ var (
readWholeLog = flag.Bool("read-whole-log", false, "read whole logs")
readOnce = flag.Bool("read-once", false, "read logs once and exit")
regex = flag.String("regex", "", "regex rule")
version = flag.Bool("version", false, "show version number")
)

func main() {
flag.Parse()

if *version {
fmt.Printf("logsend version %v\n", VERSION)
os.Exit(0)
}

if *logFile != "" {
file, err := os.OpenFile(*logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
Expand Down

0 comments on commit 7acdc85

Please sign in to comment.