Add -version option
This commit is contained in:
parent
6302dc553c
commit
a0eada9c49
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
@ -14,10 +15,18 @@ import (
|
|||
var fDebug = flag.Bool("debug", false, "show metrics as they're generated to stdout")
|
||||
var fTest = flag.Bool("test", false, "gather metrics, print them out, and exit")
|
||||
var fConfig = flag.String("config", "", "configuration file to load")
|
||||
var fVersion = flag.Bool("version", false, "display the version")
|
||||
|
||||
var Version = "unreleased"
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
if *fVersion {
|
||||
fmt.Printf("InfluxDB Tivan agent - Version %s\n", Version)
|
||||
return
|
||||
}
|
||||
|
||||
var (
|
||||
config *tivan.Config
|
||||
err error
|
||||
|
|
Loading…
Reference in New Issue