diff options
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | README | 16 | ||||
| -rw-r--r-- | TODO | 4 | ||||
| -rw-r--r-- | config.mk | 4 | ||||
| -rw-r--r-- | read-quickly.1 | 18 | ||||
| -rw-r--r-- | read-quickly.c | 8 |
6 files changed, 31 insertions, 29 deletions
@@ -1,4 +1,4 @@ -.PHONY: +.POSIX: CONFIGFILE = config.mk include $(CONFIGFILE) @@ -12,17 +12,17 @@ read-quickly: read-quickly.o $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) install: read-quickly - mkdir -p -- "$(DESTDIR)$(PREFIX)/bin" - mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1" + mkdir -p -- "$(DESTDIR)$(PREFIX)/bin/" + mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/" cp -- read-quickly "$(DESTDIR)$(PREFIX)/bin/" cp -- read-quickly.1 "$(DESTDIR)$(MANPREFIX)/man1/" uninstall: - -rm -f -- "$(DESTDIR)$(PREFIX)/read-quickly" + -rm -f -- "$(DESTDIR)$(PREFIX)/bin/read-quickly" -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/read-quickly.1" clean: - -rm -rf -- read-quickly *.o + -rm -f -- *.o *.su read-quickly .SUFFIXES: .SUFFIXES: .o .c @@ -6,16 +6,16 @@ SYNOPSIS DESCRIPTION Displays a plain-text file word-by-word in the middle - of the terminal. Words are automatically paged in a + of the terminal. Words are automatically paged at a specifiable rate, by default 2 words per second. - This is a bit slow, you should turn it up when - gradually until your performance has been optimised. - Repeated words will be indicated by alternating reverse - video highlighting. + This is a bit slow; you should gradually turn it up + until your performance has been optimised. Repeated + words will be indicated by alternating reverse video + highlighting. Escape sequences are printed as-is. - If no file is specified, or if '-' i specified, stdin + If no file is specified, or if '-' is specified, stdin will be paged. read-quickly uses a method called rapid serial visual @@ -56,8 +56,8 @@ COMMANDS q Exit. left Go to the previous word. up Go to the previous word. - right Go to next previous word. - down Go to next previous word. + right Go to the next word. + down Go to the next word. RATIONALE This should be obvious. @@ -1,5 +1,5 @@ The text shall not be centred. Rather, the position that is -to be centred is the position where it reader is most likely -to recognised the word quickest when focusing there. This +to be centred is the position where the reader is most likely +to recognise the word quickest when focusing there. This point should be highlighted. Determining this position requires a dictionary to be processed. @@ -1,6 +1,8 @@ PREFIX = /usr MANPREFIX = $(PREFIX)/share/man +CC = c99 + CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -CFLAGS = -std=c99 -O2 -Wall +CFLAGS = LDFLAGS = -s diff --git a/read-quickly.1 b/read-quickly.1 index 50ccb7d..5a1a952 100644 --- a/read-quickly.1 +++ b/read-quickly.1 @@ -1,21 +1,21 @@ .TH READ-QUICKLY 1 READ-QUICKLY .SH NAME -read-quickly \- read quickly +read-quickly \- Read quickly .SH SYNOPSIS .B read-quickly .RI [ file ] .SH DESCRIPTION Displays a plain-text file word-by-word in the middle -of the terminal. Words are automatically paged in a +of the terminal. Words are automatically paged at a specifiable rate, by default 2 words per second. -This is a bit slow, you should turn it up when -gradually until your performance has been optimised. +This is a bit slow; you should gradually turn it up +until your performance has been optimised. Repeated words will be indicated by alternating reverse video highlighting. .PP Escape sequences are printed as-is. .PP -If no file is specified, or if \- i specified, +If no file is specified, or if \- is specified, stdin will be paged. .PP .B read-quickly @@ -29,7 +29,7 @@ The rate at which the words will be printed. Defaults to 120 words per minute. .br .br -This should a positive integer, optionally +This should be a positive integer, optionally followed by a unit. If no unit is specified, words per minute will be used. Valid units are (case-insensitive): @@ -39,7 +39,7 @@ are (case-insensitive): .TQ .B w/m .TQ -.B m +.B /m .TQ .B wpmin .TQ @@ -53,7 +53,7 @@ Words per minute. .TQ .B w/sec .TQ -.B sec +.B /sec .TQ .B wps .TQ @@ -83,7 +83,7 @@ Exit. Go to the previous word. .TP .BR right ,\ down -Go to next previous word. +Go to the next word. .SH RATIONALE This should be obvious. .SH SEE ALSO diff --git a/read-quickly.c b/read-quickly.c index acd52a6..b235160 100644 --- a/read-quickly.c +++ b/read-quickly.c @@ -35,7 +35,7 @@ /** - * The a word. + * A word. */ struct word { /** @@ -55,7 +55,7 @@ struct word { static const char *argv0; /** - * Have the terminal been resized? + * Has the terminal been resized? */ static volatile sig_atomic_t caught_sigwinch = 1; @@ -174,7 +174,7 @@ get_word_rate(void) /** - * Count the number of character in a string. + * Count the number of characters in a string. * * @param s The string. * @return The number of characters in `s`. @@ -450,7 +450,7 @@ main(int argc, char *argv[]) if (display_file(ttyfd, rate)) goto fail; - /* Restore terminal configurations. */ + /* Restore terminal configuration. */ tcsetattr(ttyfd, TCSAFLUSH, &saved_stty); fprintf(stdout, "\033[?25h\033[?1049l"); fflush(stdout); |
