version 1.6, 2003/06/17 21:56:25 |
version 1.7, 2003/07/10 02:25:38 |
|
|
# |
# |
# $OpenBSD$ |
# $OpenBSD$ |
# |
# |
# Copyright (c) 2001 Todd C. Miller <Todd.Miller@courtesan.com> |
# Copyright (c) 2001, 2003 Todd C. Miller <Todd.Miller@courtesan.com> |
# |
# |
# Permission to use, copy, modify, and distribute this software for any |
# Permission to use, copy, modify, and distribute this software for any |
# purpose with or without fee is hereby granted, provided that the above |
# purpose with or without fee is hereby granted, provided that the above |
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
# |
# |
|
# Sponsored in part by the Defense Advanced Research Projects |
|
# Agency (DARPA) and Air Force Research Laboratory, Air Force |
|
# Materiel Command, USAF, under agreement number F39502-99-1-0512. |
|
# |
SPELLPROG=/usr/libexec/spellprog |
SPELLPROG=/usr/libexec/spellprog |
DICT=/usr/share/dict/words |
DICT=/usr/share/dict/words |
LOCAL_DICT=/usr/local/share/dict/words |
LOCAL_DICT=/usr/local/share/dict/words |
|
|
VTMP= |
VTMP= |
USAGE="usage: spell [-biltvx] [-d list] [-h spellhist] [-s stop] [+extra_list] [file ...]" |
USAGE="usage: spell [-biltvx] [-d list] [-h spellhist] [-s stop] [+extra_list] [file ...]" |
|
|
|
set -o posix # set POSIX mode to prevent +foo in getopts |
|
OPTIND=1 # force getopts to reset itself |
|
|
trap "rm -f $TMP $VTMP; exit 0" 0 |
trap "rm -f $TMP $VTMP; exit 0" 0 |
|
|
# Use local word/stop lists if they exist |
# Use local word/stop lists if they exist |
|
|
STOP="$STOP $LOCAL_STOP" |
STOP="$STOP $LOCAL_STOP" |
fi |
fi |
|
|
# getopts will treat +foo the same as -foo so we have to make a copy |
while getopts "biltvxd:h:m:s:" c; do |
# of the args and quit the loop when we find something starting with '+' |
|
set -A argv $0 "$@" |
|
while test "${argv[$OPTIND]#+}" = "${argv[$OPTIND]}" && \ |
|
getopts "biltvxd:h:m:s:" c; do |
|
case $c in |
case $c in |
b) LANG=$BRITISH |
b) LANG=$BRITISH |
STOP_LANG=$AMERICAN |
STOP_LANG=$AMERICAN |