name=$0
bin=/usr/lib/diction
fflag=
nflag=
lflag=-s
file=
ok=true

for arg
do
	if [ "$ok" ]; then
                case $arg in
                -f) shift; fflag="-f $1"; ok=""; shift;;
                -n) nflag=-n; shift;;
                -l) lflag=-l; shift;;
                -*) echo 1>&2 $name: invalid \'$arg\' option; exit 1;;
                 *) file="$file $arg"; shift;;
                esac
	else
		ok=true
	fi
done
/usr/lib/ss/fonts -x $file \
	| deroff $lflag \
	| $bin/diction1 $nflag $fflag \
	| sed -e "s/\[  */ [/g" -e "s/  */ /g" -e "s/^ *//" -e "s/ *\.//"
