 ;; vector of the names of files where the filter term appears on a changed line.
 ;; If no filter term is given, a changed file automatically matches.
 
-(defn matching-files [r1 r2 object filt show]
-  (let [blocks (rest (split (:out (diff r1 r2 object show)) #"^Index: |\nIndex: "))]
+(defn matching-files [r1 r2 object filt show insens]
+  (let [raw (:out (diff r1 r2 object show))
+        blocks (rest (split raw #"^Index: |\nIndex: "))
+        filt (if insens (str "(?i)" filt) filt)]
     (remove nil?
             (into []
                   (for [block blocks]

      (usage summary 1)
      (let [revlist (get-revlist optsl show object)
            revpairs (get-revpairs revlist object)]
        (diffrevpairs object filt revpairs show)
        (shutdown-agents)))))

;; TODO make get-revpairs non-recursive?
;; TODO make diffrevpairs non-recursive?

(ns revdiff.core
  (:gen-class)
