      SUBROUTINE MAIN
      INTEGER I, GETARG, VERBOS, TTY, GETLIN, NARG
      LOGICAL*1 BUF(400), CLOWER
      VERBOS = 0
      I=1
23000 IF(.NOT.(GETARG(I,BUF,40) .NE. -1))GOTO 23002
      IF(.NOT.(BUF(1) .EQ. 45 .AND. CLOWER(BUF(2)) .EQ. 118))GOTO 23003
      VERBOS = 1
      GOTO 23004
23003 CONTINUE
      IF(.NOT.(BUF(1) .EQ. 63 .AND. BUF(2) .EQ. 0))GOTO 23005
      CALL ERROR(26Husage:  rm [-v] [file] ...)
23005 CONTINUE
23004 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      IF(.NOT.(VERBOS .EQ. 1))GOTO 23007
      NARG = I - 2
      GOTO 23008
23007 CONTINUE
      NARG = I - 1
23008 CONTINUE
      IF(.NOT.(NARG .GT. 0))GOTO 23009
      I=1
23011 IF(.NOT.(GETARG(I, BUF, 40) .NE. -1))GOTO 23013
      IF(.NOT.(BUF(1) .NE. 45))GOTO 23014
      CALL RMFILE(BUF, VERBOS)
23014 CONTINUE
23012 I=I+1
      GOTO 23011
23013 CONTINUE
      GOTO 23010
23009 CONTINUE
      IF(.NOT.(TTY(1) .EQ. 0))GOTO 23016
      I=GETLIN(BUF, 1)
23018 IF(.NOT.(I .NE. -1))GOTO 23020
      BUF(I) = 0
      CALL RMFILE(BUF, VERBOS)
23019 I=GETLIN(BUF, 1)
      GOTO 23018
23020 CONTINUE
23016 CONTINUE
23010 CONTINUE
      RETURN
      END
      SUBROUTINE RMFILE(FILE, VERBOS)
      LOGICAL*1 FILE(40)
      INTEGER VERBOS
      IF(.NOT.(VERBOS .EQ. 1))GOTO 23021
      CALL REMARK(FILE)
23021 CONTINUE
      CALL REMOVE(FILE)
      RETURN
      END
