 (defn -main [& args]
   (let [commentDict (read-json)
         [root & filetypes] args]
+    ;(println commentDict)
     ;(println args)
+    ;(println root)
     ;(println filetypes)
-    (println (read-files commentDict root filetypes)))
+    (cond filetypes (println (read-files commentDict root filetypes))
+          root (println (read-files commentDict root))
+          :else (println (read-files commentDict))))
 )


(defn read-json
  ([]
   (json/read-str (slurp "./src/codeitlater/comments.json")))
  ([path]
   (json/read-str (slurp "path/comments.json"))))


;; This regex expression get help from: https://stackoverflow.com/questions/45848999/clojure-regex-delete-whitespace-in-pattern

  ([commentDict]
   (doall (for [filepath (get-all-files)
                :when (not (.isDirectory (io/file filepath)))
                :let [mark (get commentDict (re-find #"(?<=\w)\.\w+$" filepath))]
                :when mark]
            (conj (read-comments-in-file filepath mark)
                  filepath))))
  ([commentDict root]
   (doall (for [filepath (get-all-files root)
                :when (not (.isDirectory (io/file filepath)))
                :let [mark (get commentDict (re-find #"(?<=\w)\.\w+$" filepath))]
                :when mark]
            (conj (read-comments-in-file filepath mark)
                  filepath))))
