Skip to content

Commit

Permalink
re-add kingpin parsing and version output
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Oelmüller authored and zwopir committed Feb 27, 2019
1 parent 9efb119 commit e4f6e4b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"flag"
"fmt"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -81,10 +79,9 @@ func main() {
Default("stdout").Envar("LOG_OUTPUT").String()
)

if *showVersion {
fmt.Print(version.Print(Name))
os.Exit(0)
}
kingpin.Version(version.Print(Name))
kingpin.CommandLine.HelpFlag.Short('h')
kingpin.Parse()

logger := getLogger(*logLevel, *logOutput, *logFormat)

Expand Down Expand Up @@ -127,12 +124,16 @@ func main() {
}
}

if *esExportSnapshots {
prometheus.MustRegister(collector.NewSnapshots(logger, httpClient, esURL))
}

if *esExportClusterSettings {
prometheus.MustRegister(collector.NewClusterSettings(logger, httpClient, esURL))
}

if *esExportSnapshots {
prometheus.MustRegister(collector.NewSnapshots(logger, httpClient, esURL))
if *esExportIndicesSettings {
prometheus.MustRegister(collector.NewIndicesSettings(logger, httpClient, esURL))
}

// create a http server
Expand Down

0 comments on commit e4f6e4b

Please sign in to comment.