Make task name column wider in the lein -h output
To make sure longer task names such as show-profiles do not collide with task description.
This commit is contained in:
parent
1bac2ef834
commit
d95deb63fe
1 changed files with 6 additions and 1 deletions
|
@ -5,6 +5,11 @@
|
|||
[bultitude.core :as b]
|
||||
[leiningen.core.main :as main]))
|
||||
|
||||
(def ^{:const true
|
||||
:private true
|
||||
:doc "How wide the task name column is in the list of tasks produced by lein -h"}
|
||||
task-name-column-width 20)
|
||||
|
||||
(defn tasks
|
||||
"Return a list of symbols naming all visible tasks."
|
||||
[]
|
||||
|
@ -83,7 +88,7 @@
|
|||
ns-summary (:doc (meta (find-ns (doto task-ns require))))
|
||||
first-line (first (.split (help-for {} task-name) "\n"))]
|
||||
;; Use first line of task docstring if ns metadata isn't present
|
||||
(str task-name (apply str (repeat (- 13 (count task-name)) " "))
|
||||
(str task-name (apply str (repeat (- task-name-column-width (count task-name)) " "))
|
||||
(or ns-summary first-line)))
|
||||
(catch Throwable e
|
||||
(binding [*out* *err*]
|
||||
|
|
Loading…
Reference in a new issue