fix up formatting in cli usage summary
This commit is contained in:
parent
c1fcaa4837
commit
a0ef0d48e0
|
@ -1,7 +1,9 @@
|
|||
(ns mtgcoll.cli
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[clojure.tools.cli :as cli]))
|
||||
[clojure.tools.cli :as cli])
|
||||
(:use
|
||||
mtgcoll.utils))
|
||||
|
||||
(def ^:private cli-options
|
||||
[["-c" "--config EDN-CONFIG-FILE"
|
||||
|
@ -18,7 +20,7 @@
|
|||
(defn- ->actions-summary
|
||||
[]
|
||||
(->> actions
|
||||
(map (fn [[action desc]] (str " " action "\t\t" desc)))
|
||||
(map (fn [[action desc]] (str " " (pad-string 20 action) " " desc)))
|
||||
(string/join \newline)))
|
||||
|
||||
(defn- ->usage-string
|
||||
|
|
|
@ -50,3 +50,10 @@
|
|||
body (:body response)]
|
||||
(if-not (empty? body)
|
||||
body)))
|
||||
|
||||
(defn pad-string
|
||||
[n s & [c]]
|
||||
(let [c (or c \space)]
|
||||
(if (< (count s) n)
|
||||
(->> (repeat c) (concat s) (take n) (string/join))
|
||||
s)))
|
||||
|
|
Loading…
Reference in a new issue