package main import ( "bufio" "fmt" "os" "strings" "github.com/Shugyousha/stasher/conf" "github.com/Shugyousha/stasher/filter/str" "github.com/Shugyousha/stasher/input/stdin" "github.com/Shugyousha/stasher/manager" "github.com/Shugyousha/stasher/output/stdout" ) func main() { f, err := os.Open("stasher.cfg") if err != nil { fmt.Fprintf(os.Stderr, "Could not open config file 'stasher.cfg': %q\n", err) os.Exit(1) } c := conf.NewManagerFromConfig(bufio.NewReader(f)) fmt.Fprintf(os.Stderr, "config: %#v\n", c) ffmap := make(map[string]func(string) string, 10) ffmap["F"] = func(s string) string { return strings.ToUpper(s) } m := manager.Manager{ Input: stdin.New(nil), Filter: str.New(ffmap), Output: stdout.New(nil), } m.Run() }