Commit: bb8a1055f1a83152a612e30f9ed8ac2d5416007f
Parent: a3f7af3aa44498348d6a57b33301e6bc79bccd1c
Author: Randy Palamar
Date: Sun, 12 Nov 2023 15:41:58 -0700
add a jdict.1 manpage
Diffstat:
3 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -16,10 +16,13 @@ $(OBJ): config.h config.mk
jdict: $(OBJ)
$(CC) -o $@ $(OBJ) $(LDFLAGS)
-install: jdict
+install: default jdict.1
mkdir -p $(PREFIX)/bin
cp jdict $(PREFIX)/bin
chmod 755 $(PREFIX)/bin/jdict
+ mkdir -p $(MANPREFIX)/man1
+ cp jdict.1 $(MANPREFIX)/man1/jdict.1
+ chmod 644 $(MANPREFIX)/man1/jdict.1
uninstall:
rm $(PREFIX)/bin/jdict
diff --git a/config.mk b/config.mk
@@ -1,5 +1,6 @@
# See LICENSE for license details.
PREFIX = /usr/local
+MANPREFIX = $(PREFIX)/share/man
CPPFLAGS = -D_BSD_SOURCE
CFLAGS = -O3 -std=c99 -Wall -Wextra -pedantic -pthread
diff --git a/jdict.1 b/jdict.1
@@ -0,0 +1,46 @@
+.Dd November 12, 2023
+.Dt JDICT 1
+.
+.Sh NAME
+.Nm jdict
+.Nd search through japanese dictionaries
+.
+.Sh SYNOPSIS
+.Nm
+.Op Fl d Ar dictionary
+.Op Fl i
+.Ar term ...
+.
+.Sh DESCRIPTION
+The
+.Nm
+utility searches through dictionaries formatted in the yomidict
+format for
+.Ar term ...
+and outputs any found definitions to stdout.
+.Pp
+The following options are supported:
+.
+.Bl -tag -width Ds
+.It Fl d Ar dictionary
+limit search to the specified
+.Ar dictionary .
+.It Fl i
+run the program in interactive mode.
+.El
+.
+.Sh CUSTOMIZATION
+.Nm
+is customized by modifying config.h and (re)compiling the program.
+.
+.Sh AUTHORS
+.An Randy Palamar Aq Mt randy@rnpnr.xyz
+.
+.Sh CAVEATS
+Many of the newer dictionaries available online contain full json
+data. This throws away the benefits of the original yomidict
+format and requires a full json parser to handle. This is outside
+the scope of this utility and will not be implemented. To check if
+the dictionary is supported open a term_bank_XX.json file and check
+for field names. If they are present the dictionary is not
+supported.