      SUBROUTINE MAIN
      LOGICAL*1 LIN(512)
      INTEGER I, FD
      INTEGER GETARG, OPEN
      CALL QUERY(22Husage:  rev [file] ...)
      FD = -3
      I=1
23000 IF (.NOT.(GETARG(I, LIN, 40) .NE. -1))GOTO 23002
      IF (.NOT.(LIN(1) .EQ. 45 .AND. LIN(2) .EQ. 0))GOTO 23003
      FD = 1
      GOTO 23004
23003 CONTINUE
      FD = OPEN(LIN, 1)
      IF (.NOT.(FD .EQ. -3))GOTO 23005
      CALL CANT(LIN)
23005 CONTINUE
23004 CONTINUE
      CALL REVL(FD)
      IF (.NOT.(FD .NE. 1))GOTO 23007
      CALL CLOSE(FD)
23007 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      IF (.NOT.(FD .EQ. -3))GOTO 23009
      CALL REVL(1)
23009 CONTINUE
      RETURN
      END
      SUBROUTINE REVL(FD)
      INTEGER FD, I
      INTEGER GETLIN
      LOGICAL*1 LIN(512)
      I = GETLIN(LIN, FD)
23011 IF (.NOT.(I .NE. -1))GOTO 23013
      I = I - 1
23014 IF (.NOT.(I .GT. 0))GOTO 23016
      CALL PUTCH(LIN(I),2)
23015 I = I - 1
      GOTO 23014
23016 CONTINUE
      CALL PUTCH(10,2)
23012 I = GETLIN(LIN, FD)
      GOTO 23011
23013 CONTINUE
      RETURN
      END
