A little change here:

ARGV.each do |word|
    if word[0, 2] == '-t'
      found_opt_t = true
      break   #<---if found option, no reason to continue loop
    end
end
-- 
Posted via http://www.ruby-forum.com/.