1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#!/bin/sh
usage (){
cat <<EOF
This program is intended to create DICTD database files
necessary for integrating plugin into DICTD.
It creates two special entries:
00-database-plugin
Its "definition" is a filename for plugin (possibly .so)
You should specify the filename as a parameter (see below).
If the filename does not begin with '.' or '/', it is prepended with
\$libexecdir. It is a compile time option. You can change this behaviour
by editing Makefile or running ./configure --libexecdir=...
00-database-plugin-data
Its "definition" is a data passed to plugin during
initialization.
Take a note that -c5 input format is used. You cannot specify
another one.
usage:
dictfmt_plugin [OPTIONS] <path_to_plugin> [DICTFMT_OPTIONS] [datafiles...]
OPTIONS:
--help displays this help
DICTFMT_OPTIONS:
all they are from dictfmt
EOF
}
while test $# -ne 0; do
case $1 in
--help)
usage
exit 0;;
-*)
echo "invalid argument '$1'" 1>&2
echo "run '$0 --help' for help" 1>&2
exit 1;;
*)
break;;
esac
shift
done
filename=$1
shift
if test -z "$filename"; then
usage
exit 1
fi
{
echo -en "\
_____\n\
\n\
00-database-plugin\n\
$filename\n\
_____\n\
\n\
00-database-plugin-data\n\
"
cat
} |
dictfmt -q --without-header --without-url -c5 "$@"
|