mailq-inspector/main.go
2018-12-29 17:50:34 +01:00

25 lines
455 B
Go

package main
import (
"bufio"
"fmt"
"os"
"mailq-inspector/parser"
)
func main() {
// Read data from stdin
scanner := bufio.NewScanner(os.Stdin)
entries, err := parser.ParseMailQ(scanner)
if err != nil {
fmt.Printf("Got error from parser: %s\n", err.Error())
os.Exit(1)
} else {
for _, entry := range entries {
fmt.Printf("%s\n", entry.String())
}
os.Exit(0)
}
}