Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add verison flag #3

Merged
merged 1 commit into from
Nov 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/shimesaba/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"os"
"os/signal"
"runtime"
"strings"
"syscall"

Expand Down Expand Up @@ -36,6 +37,7 @@ var (
debug bool
dryRun bool
backfill uint
version bool
configFiles stringSlice
)

Expand All @@ -57,6 +59,7 @@ func main() {
flag.StringVar(&mackerelAPIKey, "mackerel-apikey", "", "for access mackerel API")
flag.BoolVar(&debug, "debug", false, "output debug log")
flag.BoolVar(&dryRun, "dry-run", false, "report output stdout and not put mackerel")
flag.BoolVar(&version, "version", false, "show version")
flag.UintVar(&backfill, "backfill", 3, "generate report before n point")
flag.VisitAll(envToFlag)
flag.Parse()
Expand All @@ -66,6 +69,11 @@ func main() {
minLevel = "debug"
}
logger.Setup(os.Stderr, minLevel)
if version {
log.Printf("[info] shimesaba version : %s", Version)
log.Printf("[info] go runtime version: %s", runtime.Version())
return
}
if backfill == 0 {
log.Println("[error] backfill count must positive avlue")
os.Exit(1)
Expand Down