home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / groff-1.09-bin.lha / bin / nroff < prev    next >
Text File  |  1993-12-19  |  677b  |  53 lines

  1. #!/bin/sh
  2. # Emulate nroff with groff.
  3.  
  4. prog="$0"
  5. # Default device.
  6. T=-Tascii
  7. opts=
  8.  
  9. for i
  10. do
  11.     case $1 in
  12.     -h)
  13.         opts="$opts -P-h"
  14.         ;;
  15.     -[eq]|-s*)
  16.         # ignore these options
  17.         ;;
  18.     -[mrnoT])
  19.         echo "$prog: option $1 requires an argument" >&2
  20.         exit 1
  21.         ;;
  22.     -i|-[mrno]*)
  23.         opts="$opts $1";
  24.         ;;
  25.  
  26.     -Tascii|-Tlatin1)
  27.         T=$1
  28.         ;;
  29.     -T*)
  30.         # ignore other devices
  31.         ;;
  32.     --)
  33.         shift
  34.         break
  35.         ;;
  36.     -)
  37.         break
  38.         ;;
  39.     -*)
  40.         echo "$prog: invalid option $1" >&2
  41.         exit 1
  42.         ;;
  43.     *)
  44.         break
  45.         ;;
  46.     esac
  47.     shift
  48. done
  49.  
  50. # This shell script is intended for use with man, so warnings are
  51. # probably not wanted.  Also load nroff-style character definitions.
  52. exec groff -Wall -mtty-char $T $opts ${1+"$@"}
  53.