Skip to content

Commit

Permalink
[clean]関数の順番を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
jiro4989 committed Nov 17, 2018
1 parent df4733a commit 5b30bcb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/meme/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
(map #(str/lower-case %))
distinct))

(defn format-line
"オプションごとの出力を返す"
[m options]
(let [{:keys [none padding-size delimiter]} options
weight (:weight m)
n (:name m)]
; オプション数が増えたら出力が変わる可能性があるためcondを使用
(cond
none (format "%s" n)
:else (format (str "%" padding-size "d" delimiter "%s") weight n))))

(def cli-options
; 重み数値の空白詰め桁数
[["-p" "--padding-size int" "padding size"
Expand All @@ -37,17 +48,6 @@
"options:"
summary]))

(defn format-line
"オプションごとの出力を返す"
[m options]
(let [{:keys [none padding-size delimiter]} options
weight (:weight m)
n (:name m)]
; オプション数が増えたら出力が変わる可能性があるためcondを使用
(cond
none (format "%s" n)
:else (format (str "%" padding-size "d" delimiter "%s") weight n))))

(defn -main
[& args]
(let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
Expand Down

0 comments on commit 5b30bcb

Please sign in to comment.