                           :files {"ls" {:mod #{:x}
                                         :type :file
                                         :fn ls
-                                        :args []}
+                                        :args []
+                                        :help "`ls` tells you what in your current directory."}
                                   "cd" {:mod #{:x}
                                         :type :file
                                         :fn cd
-                                        :args [:file]}
+                                        :args [:file]
+                                        :help "`cd` changes your current directory."}
                                   "clear" {:mod #{:x}
                                            :type :file
                                            :fn clear
-                                           :args []}}}
+                                           :args []
+                                           :help "`clear` clears the screen."}
+                                  "help" {:mod #{:x}
+                                          :type :file
+                                          :fn help
+                                          :args [:cmd]
+                                          :help "`help` teaches you about other commands."}}}
                    "usr" {:mod #{:r}
                           :type :dir
                           :files {}}}}

(defn fs-cursor []
  (om/ref-cursor (get-in (om/root-cursor state/app-state) [:characters :nix :fs])))

(declare files)

(defn ls []
  (let [fs @(fs-cursor)
        dir (get-in (:root fs) (interleave (repeat :files) (:cwd fs)))]
    (str/join "\t" (keys (:files dir)))))

(defn cd [dir]
  (if (= [".."] dir)
    (om/transact! (fs-cursor) #(assoc % :cwd (drop-last (:cwd %))))
    (let [path (str/split dir "/")
          cwd (:cwd @(fs-cursor))
          new-cwd (concat cwd path)]
      (om/transact! (fs-cursor) #(assoc % :cwd new-cwd))))

      (if (empty? cwd)
        (trie/build (cons ".." (files cwd)))
        (trie/build (files cwd))))
    ;; Looking for a valid command
    (= :cmd args-spec)
    (trie/build (keys (command-map)))
    ;; Pre-specified parameters
    :default
    (trie/build args-spec)))
