1
zero-epwing-go/cmd/main.go
2020-12-31 19:52:25 -08:00

26 lines
370 B
Go

package main
import (
"log"
"os"
"github.com/FooSoft/zero-epwing-go/zig"
)
func main() {
book, err := zig.Load(os.Args[1])
if err != nil {
log.Fatal(err)
}
fp, err := os.Create(os.Args[2])
defer fp.Close()
for _, subbook := range book.Subbooks {
for _, entry := range subbook.Entries {
fp.WriteString(entry.Heading)
fp.WriteString("\n")
}
}
}