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
}
func parseArgs() map[string]string {
var args map[string]string
return args
}

12
main.go
View File

@ -2,8 +2,10 @@ package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"os/exec"
"strings"
"time"
@ -89,7 +91,15 @@ func (s *Stream) handle() {
}
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 {
go stream.handle()