Merge pull request #440 from influxdata/feature/358-version-flag

Add version option
pull/10616/head
Chris Goller 2016-11-09 16:07:31 -06:00 committed by GitHub
commit 5a8651953f
2 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,11 @@ func main() {
os.Exit(code)
}
if srv.ShowVersion {
log.Printf("Chronograf %s (git: %s)\n", Version, Commit)
os.Exit(0)
}
if err := srv.Serve(); err != nil {
log.Fatalln(err)
}

View File

@ -40,7 +40,8 @@ type Server struct {
ReportingDisabled bool `short:"r" long:"reporting-disabled" description:"Disable reporting of usage stats (os,arch,version,cluster_id) once every 24hr" env:"REPORTING_DISABLED"`
LogLevel string `short:"l" long:"log-level" value-name:"choice" choice:"debug" choice:"info" choice:"warn" choice:"error" choice:"fatal" choice:"panic" default:"info" description:"Set the logging level" env:"LOG_LEVEL"`
BuildInfo BuildInfo
ShowVersion bool `short:"v" long:"version" description:"Show Chronograf version info"`
BuildInfo BuildInfo
Listener net.Listener
handler http.Handler