adding -version flag back into app and probe for the release script

This commit is contained in:
Paul Bellamy
2015-08-19 10:36:55 +01:00
parent fc75b3dc58
commit 3fa86fe6ce
2 changed files with 15 additions and 2 deletions

View File

@@ -45,9 +45,15 @@ func main() {
captureInterfaces = flag.String("capture.interfaces", interfaces(), "packet capture on these interfaces")
captureOn = flag.Duration("capture.on", 1*time.Second, "packet capture duty cycle 'on'")
captureOff = flag.Duration("capture.off", 5*time.Second, "packet capture duty cycle 'off'")
printVersion = flag.Bool("version", false, "print version number and exit")
)
flag.Parse()
if *printVersion {
fmt.Println(version)
return
}
var (
hostName = hostname()
hostID = hostName // TODO: we should sanitize the hostname