                                           :fn touch-cmd
                                           :args [:alpha]
                                           :help "`touch` creates an empty file."}}}
-                   "usr" {:mod #{:r}
+                   "usr" {:mod #{:r :w}
                           :type :dir
                           :files {}}}}
     :cwd []


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

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

