File: spell

package info (click to toggle)
spellprogs 1.11-4
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 44 kB
  • ctags: 2
  • sloc: sh: 55; makefile: 32
file content (29 lines) | stat: -rwxr-xr-x 830 bytes parent folder | download
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
#!/bin/sh
#
# A front-end to ispell which allows it to act like the "spell" program
#
# Ispell command line switches-handling added by David Frey <david@eos.lugs.ch>

WORDCHARS=""
# XXX Latin1-centric

ARGS=""
while getopts aAbBcCd:Def:lLMN:p:PsStTw:vV+: s; do
  case $s in
   a|A|c|e|f|l|L|M|N)	;; # ignored
   b|B|C|n|m|P|S|t|x|V)	ARGS="$ARGS -$s" ;; # pass these options through
   d|p|W|T)         	ARGS="$ARGS -$s $OPTARG" ;; # options with params
   w)			WORDCHARS="$OPTARG" ;; 
   +)			ARGS="$ARGS -p $OPTARG" ;; # alternate personal dict.
  esac
done
shift `expr $OPTIND - 1`

if [ -r spell.ok ]; then
  ARGS="$ARGS -p spell.ok"; 
fi

case $# in
	0)	ispell -l -w $WORDCHARS $ARGS| sort | uniq ;;
	*)	cat $* | ispell -l -w $WORDCHARS $ARGS| sort | uniq ;;
esac