summaryrefslogtreecommitdiff
path: root/internal/flags/flags.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 08:39:35 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 08:39:35 +0200
commitb3327d17f9f5c7080b05d6d5457cf25550d40ad9 (patch)
tree090e66047c14c9183058bd68a8d4afc12b48f399 /internal/flags/flags.go
parent38620359537d77ab10acb888d266d3c6eb16fc9b (diff)
Add --open support for live flamegraph browser launch
Diffstat (limited to 'internal/flags/flags.go')
-rw-r--r--internal/flags/flags.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/flags/flags.go b/internal/flags/flags.go
index bf348c7..c4ee7d2 100644
--- a/internal/flags/flags.go
+++ b/internal/flags/flags.go
@@ -65,6 +65,8 @@ type Flags struct {
FlamegraphEnable bool
LiveFlamegraph bool
LiveInterval time.Duration
+ OpenLiveBrowser bool
+ OpenCommand string
FlamegraphName string
TUIExportEnable bool
@@ -122,6 +124,8 @@ func parse() error {
flag.BoolVar(&singleton.FlamegraphEnable, "flamegraph", false, "Enable flamegraph builder")
flag.BoolVar(&singleton.LiveFlamegraph, "live", false, "Enable live flamegraph mode")
flag.DurationVar(&singleton.LiveInterval, "live-interval", 200*time.Millisecond, "Live flamegraph refresh interval")
+ flag.BoolVar(&singleton.OpenLiveBrowser, "open", false, "Auto-open live flamegraph URL in a browser (used with -live)")
+ flag.StringVar(&singleton.OpenCommand, "open-cmd", "", "Custom command to open live flamegraph URL; use {url} placeholder or URL is appended")
flag.StringVar(&singleton.FlamegraphName, "name", "default", "Name of the flamegraph, used to generate the SVG file")
flag.BoolVar(&singleton.TUIExportEnable, "tuiExport", true, "Enable writing TUI snapshot export files")