#!/bin/sh

# Ispell compatibility script for Aspell

command=""

for p 
do
  case $p in 
  -a|-A|-l|-c|-e*|-v*|-D) command=$p ;; 
  -*                    ) ;;
  *                     ) command=${command:="-"} ;;
  esac
done

case $command in
-A|-D       ) echo "Aspell does not support the $command mode.";;
-a|-v*      ) exec aspell "$@" ;;
-l          ) shift; exec aspell list "$@" ;;
-c          ) shift; exec aspell munch "$@" ;;
-e          ) shift; exec aspell expand "$@" ;;
-e?         ) shift; exec aspell expand `expr substr $command 3 1` "$@" ;;
"-"         ) exec aspell check "$@" ;;
*           ) echo "Ispell compatibility script for Aspell."
              echo "Usage: $0 [options] -a|-l|-v[v]|-c|-e[1-4]|<file>"
              exit 1 ;;
esac
