                         "id" (get arguments 1)
                         "due-date" (unparse-date (t/plus (parse-date (:issue-date options))
                                                          (t/days (:net options)))))))
-
-(defn cwd []
-  (System/getProperty "user.dir"))
-
-(defn get-invoice-filenames []
-  (filter #(.endsWith % ".json") (map #(.getName %) (file-seq (io/file (cwd))))))
-
-(defn read-all-invoices []
-  (map read-json (get-invoice-filenames)))
-
-(defn options-to-filter [options]
-  (fn [invoice]
-    (every? #(= (get options %) (get invoice (name %))) (keys options))))
-
-(defn pretty-print-invoice [invoice]
-  (format (->> ["\nInvoice #%s"
-                "Client: %s"
-                "Issue date: %s"
-                "Due date: %s (Net %d)"
-                "Amount: %d %s"]
-               (string/join \newline))
-          (get invoice "id")
-          (get invoice "client")
-          (get invoice "issue-date")
-          (get invoice "due-date")
-          (get invoice "net")
-          (get invoice "amount")
-          (get invoice "currency")))
 
 (defn data [options]
   (println (json/write-str (filter (options-to-filter options) (read-all-invoices)))))

      errors (exit 1 (error-msg errors)))
    ;; Execute program with options
    (case (first arguments)
      "create" (create options arguments)
      "data" (data options)
      "list" (list_ options)
      "record-payment" (record-payment options arguments)
      (exit 1 (usage summary)))))

            [clj-time.format :as f]
            [clojure.string :as string])
  (:gen-class))

(defn cwd []
  (System/getProperty "user.dir"))

(def date-formatter
  (f/formatter "yyyy-MM-dd"))
