2018-12-29 01:42:50 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-12-29 18:09:44 +01:00
|
|
|
"bufio"
|
|
|
|
"fmt"
|
|
|
|
"mailq-inspector/parser"
|
|
|
|
"os"
|
2018-12-29 01:42:50 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2018-12-29 18:09:44 +01:00
|
|
|
// 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)
|
|
|
|
}
|
2018-12-29 01:42:50 +01:00
|
|
|
}
|