This commit is contained in:
ppom 2023-03-24 17:52:00 +01:00
parent 75e2f95ff9
commit 193481a0ce
2 changed files with 11 additions and 6 deletions

View File

@ -133,8 +133,3 @@ func parseConf(filename string) *Conf {
return &conf return &conf
} }
func parseArgs() map[string]string {
var args map[string]string
return args
}

12
main.go
View File

@ -2,8 +2,10 @@ package main
import ( import (
"bufio" "bufio"
"flag"
"fmt" "fmt"
"log" "log"
"os"
"os/exec" "os/exec"
"strings" "strings"
"time" "time"
@ -89,7 +91,15 @@ func (s *Stream) handle() {
} }
func main() { func main() {
conf := parseConf("./reaction.yml") confFilename := flag.String("c", "", "configuration file. see an example at https://framagit.org/ppom/reaction/-/blob/main/reaction.yml")
flag.Parse()
if *confFilename == "" {
flag.PrintDefaults()
os.Exit(2)
}
conf := parseConf(*confFilename)
for _, stream := range conf.Streams { for _, stream := range conf.Streams {
go stream.handle() go stream.handle()