Run parseflags, always.

This commit is contained in:
David Newhall II 2019-06-23 20:05:42 -07:00
parent 17a8be1eec
commit ed9c71961d
1 changed files with 1 additions and 4 deletions

View File

@ -22,10 +22,7 @@ import (
func Start() error { func Start() error {
log.SetFlags(log.LstdFlags) log.SetFlags(log.LstdFlags)
up := &UnifiPoller{} up := &UnifiPoller{}
if os.Args != nil && len(os.Args) > 1 { if up.ParseFlags(os.Args[1:]); up.ShowVer {
up.ParseFlags(os.Args[1:])
}
if up.ShowVer {
fmt.Printf("unifi-poller v%s\n", Version) fmt.Printf("unifi-poller v%s\n", Version)
return nil // don't run anything else w/ version request. return nil // don't run anything else w/ version request.
} }