feat: support custom --config path in CLI and GUI

Add config.LoadFrom/SaveTo for arbitrary paths and thread a --config
flag through both entry points:
- CLI: --config loads a file first; explicit flags override file values
- GUI: --config selects the settings file used for load and save
- tests for LoadFrom/SaveTo and default fallback
This commit is contained in:
2026-09-19 08:35:07 +01:00
parent b9a539e133
commit 34efbaf26d
5 changed files with 128 additions and 27 deletions
+10 -1
View File
@@ -3,12 +3,21 @@
//
// The streaming engine lives in internal/flinger; this command only wires the
// GUI and tray around it. Headless use is handled by cmd/teleportfling.
//
// Usage:
//
// teleportfling-gui [--config PATH]
package main
import (
"flag"
"teleportfling/internal/gui"
)
func main() {
gui.Run()
configPath := flag.String("config", "", "config file path (default: ~/.config/teleportfling/config.json)")
flag.Parse()
gui.Run(*configPath)
}