From 92b8af6c81105323912db2300808b87f623970a1 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 26 Nov 2019 17:30:24 +0000 Subject: Improve usage notice --- cmd/pdfbook/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/pdfbook/main.go b/cmd/pdfbook/main.go index 56f981d..6532f26 100644 --- a/cmd/pdfbook/main.go +++ b/cmd/pdfbook/main.go @@ -14,6 +14,16 @@ import ( "rescribe.xyz/bookpipeline" ) +const usage = `Usage: pdfbook [-c] [-s] dir out.pdf + +Creates a searchable PDF from a directory of hOCR and image files. + +If a 'best' file exists in the directory, each hOCR listed in it is +used to provide the searchable text for each page. Otherwise pdfbook +just looks for a .hocr with the same file base as the image for the +searchable text. +` + type Pdfer interface { Setup() error AddPage(imgpath, hocrpath string, smaller bool) error @@ -99,7 +109,7 @@ func main() { colour := flag.Bool("c", false, "colour") smaller := flag.Bool("s", false, "smaller") flag.Usage = func() { - fmt.Fprintln(flag.CommandLine.Output(), "Usage: pdfbook [-c] [-s] hocrdir out.pdf") + fmt.Fprintln(flag.CommandLine.Output(), usage) flag.PrintDefaults() } flag.Parse() -- cgit v1.2.1-24-ge1ad