feat: add daemon mode flag
Adds a `-daemon` flag to run the application in the background without the interactive terminal UI. It outputs log lines to standard output instead of utilizing `charmbracelet/bubbletea`.
This commit is contained in:
+4
-1
@@ -9,10 +9,13 @@ import (
|
||||
)
|
||||
|
||||
// Run loads configuration and starts the terminal UI.
|
||||
func Run(ctx context.Context) error {
|
||||
func Run(ctx context.Context, daemon bool) error {
|
||||
cfg, err := config.LoadDefault()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if daemon {
|
||||
return tui.RunDaemon(ctx, tui.Options{Streamers: cfg.Streamers})
|
||||
}
|
||||
return tui.Run(ctx, tui.Options{Streamers: cfg.Streamers})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user