Skip to content

Commit

Permalink
Help can use tasks from leiningen.core.main now.
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Aug 9, 2012
1 parent 5e2ff4e commit 501fb95
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/leiningen/help.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@
"Display a list of tasks or help for a given task."
(:require [clojure.string :as string]
[clojure.java.io :as io]
[bultitude.core :as b]
[leiningen.core.main :as main]))

(def ^{:private true
:doc "Width of task name column in list of tasks produced by help task."}
task-name-column-width 20)

(defn tasks
"Return a list of symbols naming all visible tasks."
[]
(->> (b/namespaces-on-classpath :prefix "leiningen")
(filter #(re-find #"^leiningen\.(?!core|main|util)[^\.]+$" (name %)))
(distinct)
(sort)))

(defn- get-arglists [task]
(for [args (or (:help-arglists (meta task)) (:arglists (meta task)))]
(vec (remove #(= 'project %) args))))
Expand Down Expand Up @@ -103,7 +94,7 @@ deploying and copying info."
([project]
(println "Leiningen is a tool for working with Clojure projects.\n")
(println "Several tasks are available:")
(doseq [task-ns (tasks)]
(doseq [task-ns (main/tasks)]
(println (help-summary-for task-ns)))
(println "\nRun lein help $TASK for details.")
(if-let [aliases (:aliases project)]
Expand Down

0 comments on commit 501fb95

Please sign in to comment.