    and return the latest version. You can pass --repos which is expected to be a
    comma delimited list of repository names. If it is not passed, all repositories
    will be searched."
-  {[term] :latest-version, repos :repos}
+  {[term] :latest-version, repos :repos update :update}
   (let [repos (select-repos repos)
         [group-id artifact-id] (.split term "/")
         query (str "g:" group-id " AND a:" (or artifact-id group-id))]
     (doseq [[id url] repos]
       (download-index id url)
-      (update-repo id url))
+      (when update (update-repo id url))
+      (needs-updating? id url))
     (let [result (first (sort-by :version (comp unchecked-negate compare)
                                  (filter (comp #{term} identifier)
                                          (mapcat #(sherlock/search % query 10 Integer/MAX_VALUE)

   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."
  {[page] :page repos :repos search :search}
  (let [page (if page (Integer. page) 1)]
    (binding [sherlock/*page-size* 10]
      (doseq [[id url] (select-repos repos)]
        (download-index id url)
        (update-repo id url)
        (print-results
         id page
         (sherlock/get-page page (sherlock/search url (join " " search) page)))))))

    (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]
  (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
