diff --git a/cmd/direttoforo/main.go b/cmd/direttoforo/main.go index 2f7c855..d20dd9d 100644 --- a/cmd/direttoforo/main.go +++ b/cmd/direttoforo/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "fmt" "git.lattuga.net/boyska/direttoforo.git/liquidsoap" "os" @@ -17,12 +18,15 @@ func outUI(output chan liquidsoap.Output) { } func main() { + liqfile := flag.String("liq", "foo.liq", "Path to liquidsoap script to run") + flag.Parse() + killLs := make(chan struct{}) // when it is closed, liquidsoap will die killed := make(chan os.Signal, 1) signal.Notify(killed, os.Interrupt) // ctrl-c - output, exit, err := liquidsoap.RunLiquidsoap("foo.liq", killLs) + output, exit, err := liquidsoap.RunLiquidsoap(*liqfile, killLs) if err != nil { - fmt.Fprintln(os.Stderr, err) + fmt.Fprintln(os.Stderr, "Error spawning liquidsoap", err) os.Exit(1) } @@ -51,7 +55,7 @@ func main() { select { case how := <-exit: // liquidsoap exits if !how.Success() { - fmt.Fprintln(os.Stderr, how.Err) + fmt.Fprintln(os.Stderr, "liquidsoap terminated,", how.Err) os.Exit(1) } os.Exit(0)