mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-18 21:09:38 +00:00
adding -version flag back into app and probe for the release script
This commit is contained in:
11
app/main.go
11
app/main.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
@@ -20,11 +21,17 @@ var version = "dev"
|
||||
|
||||
func main() {
|
||||
var (
|
||||
window = flag.Duration("window", 15*time.Second, "window")
|
||||
listen = flag.String("http.address", ":"+strconv.Itoa(xfer.AppPort), "webserver listen address")
|
||||
window = flag.Duration("window", 15*time.Second, "window")
|
||||
listen = flag.String("http.address", ":"+strconv.Itoa(xfer.AppPort), "webserver listen address")
|
||||
printVersion = flag.Bool("version", false, "print version number and exit")
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
if *printVersion {
|
||||
fmt.Println(version)
|
||||
return
|
||||
}
|
||||
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
id := strconv.FormatInt(rand.Int63(), 16)
|
||||
log.Printf("app starting, version %s, ID %s", version, id)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user