24 lines
387 B
Go
24 lines
387 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"mailq-inspector/parser"
|
|
"os"
|
|
)
|
|
|
|
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)
|
|
}
|
|
}
|