   (string/split x #":" 2))
 
 (defn parse-set [x]
-  (let [[nmlkey val] (string/split x #"=" 2)
-        [nml key] (parse-get nmlkey)]
+  (let [[nml+key val] (string/split x #"=" 2)
+        [nml key] (parse-get nml+key)]
     [nml key val]))
 
 (def cliopts

  (let [{:keys [options arguments summary]} (cli/parse-opts args cliopts)
        gets (:get options)
        sets (:set options)
        tree (nmltree (first arguments))]
    (if (and gets sets) (fail "Do not mix get and set operations."))
    (cond gets (doseq [[nml key] gets] (nmlget tree nml key))
          sets (println (nmlstr (nmlxform tree sets)))
          :else (println (nmlstr tree)))))

                 :ws       ""
                 :wsopt    ""))))

(defn nml-tree [fname]
  (try (parse (slurp fname))
       (catch Exception e (fail "Could not open namelist file '" fname "'."))))

(defn nml-xform [tree sets]
  (loop [t tree s sets]
    (if (empty? s)
      t
      (let [[nml key val] (first s)]
        (recur (nml-set t nml key val) (rest s))))))

;; cli

