From ba96802ba13f022047e93dfa96caddf4fff42146 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 21 Aug 2011 17:48:59 +0100 Subject: Create man page --- Makefile | 5 +++++ TODO | 2 -- config.mk | 1 + getgbook.1 | 31 +++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 getgbook.1 diff --git a/Makefile b/Makefile index 4ec498d..dbd5753 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ SCRIPTS = getgmissing.sh getgfailed.sh makebookpdf.sh DOC = README COPYING LEGAL BIN = $(SRC:.c=) +MAN = $(SRC:.c=.1) OBJ = $(SRC:.c=.o) $(LIB) all: $(BIN) @@ -30,10 +31,14 @@ util.a: $(LIB) @ranlib $@ install: all + mkdir -p $(DESTDIR)$(PREFIX)/bin cp -f $(BIN) $(SCRIPTS) $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + for f in $(MAN); do sed "s/VERSION/$(VERSION)/g" < $$f > $(DESTDIR)$(MANPREFIX)/man1/$$f; done uninstall: cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN) $(SCRIPTS) + cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN) clean: rm -f -- $(BIN) $(OBJ) util.a index.html diff --git a/TODO b/TODO index 558b8d8..f4903c4 100644 --- a/TODO +++ b/TODO @@ -16,8 +16,6 @@ add https support to get write some little tests -create man pages - have websummary.sh print the date of release, e.g. getxbook 0.3 (sig) (2011-08-02) diff --git a/config.mk b/config.mk index 2f0ec3e..6856404 100644 --- a/config.mk +++ b/config.mk @@ -3,6 +3,7 @@ VERSION = 0.3 # paths PREFIX = /usr/local +MANPREFIX = $(PREFIX)/share/man CFLAGS = -ansi -pedantic -Wall -Wextra -Werror -g -D_POSIX_C_SOURCE=200112L \ -DVERSION=\"$(VERSION)\" diff --git a/getgbook.1 b/getgbook.1 new file mode 100644 index 0000000..9440030 --- /dev/null +++ b/getgbook.1 @@ -0,0 +1,31 @@ +.\" See COPYING file for copyright, license and warranty details. +.TH GETGBOOK 1 getgbook\-VERSION +.SH NAME +getgbook \- downloads books from google books +.SH SYNOPSIS +.B getgbook +.RB [-c|-n] +.RB bookid +.SH DESCRIPTION +getgbook downloads pages of books from google books' "book +preview" service. Some pages are not available, in which +case they will be skipped. +.SH OPTIONS +.TP +.B \-c +Downloads from page codes given on stdin (one code per line). +Google books page codes are on of the following, followed by +a number: +.RB PP +.RB PR +.RB PA +.RB PT +.TP +.B \-n +Downloads from page numbers given on stdin (one number per +line). +.TP +.B bookid +is the unique ID Google assigns to each book. It is 12 +characters long. It can be found by looking for the 'id=' +part of the URL of its Google Books page. -- cgit v1.2.3