(defn ^{:added "0.3.0"} make-summary-part
"Given a single compiled option spec, turn it into a formatted string,
optionally with its default values if requested."
[show-defaults? spec]
(let [{:keys [short-opt long-opt required default default-desc desc]} spec
opt (cond (and short-opt long-opt) (str short-opt ", " long-opt)
long-opt (str " " long-opt)
short-opt short-opt)
[opt dd] (if required
[(str opt \space required)
(or default-desc (str default))]
[opt ""])]
(if show-defaults?
[opt dd (or desc "")]
[opt (or desc "")])))