diff --git a/pkg/cmd/grafana-server/main.go b/pkg/cmd/grafana-server/main.go index 22ce254773a..bdf0de65298 100644 --- a/pkg/cmd/grafana-server/main.go +++ b/pkg/cmd/grafana-server/main.go @@ -10,6 +10,7 @@ import ( "os" "os/signal" "runtime" + "runtime/debug" "runtime/trace" "strconv" "syscall" @@ -60,6 +61,7 @@ func main() { packaging = flag.String("packaging", "unknown", "describes the way Grafana was installed") v = flag.Bool("v", false, "prints current version and exits") + vv = flag.Bool("vv", false, "prints current version, all dependencies and exits") profile = flag.Bool("profile", false, "Turn on pprof profiling") profilePort = flag.Uint64("profile-port", 6060, "Define custom port for profiling") tracing = flag.Bool("tracing", false, "Turn on tracing") @@ -68,8 +70,16 @@ func main() { flag.Parse() - if *v { + if *v || *vv { fmt.Printf("Version %s (commit: %s, branch: %s)\n", version, commit, buildBranch) + if *vv { + fmt.Println("Dependencies:") + if info, ok := debug.ReadBuildInfo(); ok { + for _, dep := range info.Deps { + fmt.Println(dep.Path, dep.Version) + } + } + } os.Exit(0) }