     (case (first arguments)
       "create" (create options arguments)
       "data" (data)
+      "list" (list_ options)
       (exit 1 (usage summary)))))

        ""
        "  invadm create -c CURRENCY -r CLIENT -a AMOUNT [-f FILENAME] ID"
        "    Creates an invoice."
        ""
        "  invadm data"
        "    Dump all the data in a JSON array."]

(defn get-invoice-filenames []
  (filter is-json? (map get-io-file-name (file-seq (io/file (cwd))))))

(defn read-all-invoices []
  (map read-json (get-invoice-filenames)))

(defn data []
  (println (json/write-str (read-all-invoices))))

(defn options-to-filter [options]
  (fn [invoice]
    (every? (fn[key_](= (get options key_) (get invoice (name key_)))) (keys options))))

(defn list_ [options]
  (println (json/write-str (filter (options-to-filter options) (read-all-invoices)))))

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