1
zero-epwing-go/cmd/main.go

26 lines
370 B
Go
Raw Normal View History

2021-01-01 03:52:25 +00:00
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")
}
}
}