     (sherlock/update-index url)
     (new-hash url)))
 
+
+(defn needs-updating? [id url]
+  (when (and (not= (slurp (hash-location url))
+                   (slurp (hash-url url))))
+    (println (format "The index for %s is out of date. Pass --update to update it." id))))
+
 (defn update-repo [id url]
-  (when (and (not= (slurp (hash-location url))
-                   (slurp (hash-url url)))
-             (yes-or-no
-              (format "The index for %s is out of date. Do you want to update it now?" id)))
-    (log (str "Updating index for " id ". This might take a bit."))
-    (sherlock/update-index url)
-    (new-hash url)))
+  (log (str "Updating index for " id ". This might take a bit."))
+  (sherlock/update-index url)
+  (new-hash url))
 
 (defn identifier [{:keys [group-id artifact-id]}]
   (if group-id

(ns cake.tasks.search
  (:use cake
        cake.core
        [cake.utils :only [yes-or-no]]
        [bake.core :only [log]]
        [clojure.string :only [join]]
        [clojure.java.io :only [file copy reader]])

   lucene indexes for your maven repositories.
   Options:
     --page   -- The page number to fetch (each page is 10 results long).
     --repos  -- ids of repositories to search delimited by commas.
     --update -- Updates indices for repos you specify."
  {[page] :page repos :repos search :search update :update}
  (let [page (if page (Integer. page) 1)]
    (binding [sherlock/*page-size* 10]
      (doseq [[id url] (select-repos repos)]
        (download-index id url)
        (when update (update-repo id url))
        (needs-updating? id url)
        (print-results
         id page
         (sherlock/get-page page (sherlock/search url (join " " search) page)))))))
