                                   "cd" {:mod #{:x}
                                         :type :file
                                         :fn cd-cmd
-                                        :args [:file]
+                                        :args [:dir]
                                         :help "`cd` changes your current directory."}
                                   "clear" {:mod #{:x}
                                            :type :file

    (apply concat 
           ;; Flattened list of lists of command structures
           (map #(cond
                   (= :dir (:type (second %))) (commands (second %))
                   (and (= :file (:type (second %))) (contains? (:mod (second %)) :x)) [(assoc (second %) :name (first %))]
                   :default [])
                files))))



;; TODO: cache delay evaluation
(defn- alpha-trie [level]
  (let [alpha "abcdefghijklmnopqrstuvwxyz"
        t (reduce #(assoc %1 %2 (delay (alpha-trie (+ 1 level)))) {} alpha)]
    (if (< 0 level) (assoc t "" "") t)))
