        (binding [*compile-path* compile-path]
          ;; TODO: can we catch only task-level arity problems here?
          ;; compare args and (:arglists (meta (resolve-task task)))?
-         (apply (resolve-task task) args))
+         (run-task task args))
        ;; In case tests or some other task started any:
        (shutdown-agents)))
   ([] (apply -main (or *command-line-args* ["help"]))))

     (catch java.io.FileNotFoundException e
       error-fn))))

(defn ns->path [n]
  (str (.. (str n)
           (replace \- \_)

(ns leiningen.core
  (:use [clojure.contrib.with-ns]
        [clojure.contrib.find-namespaces :only [find-namespaces-on-classpath]])
  (:import [java.io File])
  (:gen-class))

