mailq-inspector/main.go

25 lines
455 B
Go
Raw Normal View History

2018-12-29 01:42:50 +01:00
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)
}
}