home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / GROFFEXE / BIN / NROFF.CMD < prev    next >
OS/2 REXX Batch file  |  1994-01-02  |  743b  |  55 lines

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