We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78444ee commit 55a4eb1Copy full SHA for 55a4eb1
main.go
@@ -17,16 +17,23 @@ func main() {
17
var host string
18
var dbgFile string
19
var port int
20
+ var versionFlag bool
21
flag.StringVar(&host, "host", "localhost", "The pprof server IP or hostname")
22
flag.IntVar(&port, "port", 6060, "The pprof server port")
23
flag.StringVar(&dbgFile, "debug", "", "Path to debug file")
24
+ flag.BoolVar(&versionFlag, "v", false, "Print version of roumon and exit")
25
flag.Parse()
26
27
version := "dev"
28
if info, ok := debug.ReadBuildInfo(); ok {
29
version = info.Main.Version
30
}
31
32
+ if versionFlag {
33
+ fmt.Println(version)
34
+ return
35
+ }
36
+
37
if len(dbgFile) > 0 {
38
f, err := os.OpenFile(dbgFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
39
if err != nil {
0 commit comments