Skip to content

Commit

Permalink
Add version flag
Browse files Browse the repository at this point in the history
Add `--version` flag to kingpin.

Fixes: #716

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed Jan 11, 2022
1 parent 8a56b28 commit 956b4d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (sc *SafeConfig) ReloadConfig(configFile string) (err error) {
func main() {
promlogConfig := &promlog.Config{}
flag.AddFlags(kingpin.CommandLine, promlogConfig)
kingpin.Version(version.Print("snmp_exporter"))
kingpin.HelpFlag.Short('h')
kingpin.Parse()
logger := promlog.New(promlogConfig)
Expand Down

0 comments on commit 956b4d6

Please sign in to comment.