         f     (fn [k v] [child k (if (= (nmlstr k) match) (vnew v) v)])]
     (insta/transform {child f} tree)))
 
-(defn nmltree [f]
-  (try (parse (slurp f))
-       (catch Exception e (fail "Could not open namelist file '" f "'"))))
+(defn nmltree [fname]
+  (try (parse (slurp fname))
+       (catch Exception e (fail "Could not open namelist file '" fname "'"))))
 
-(defn process [tree commands]
+(defn nk [x]
+  (string/split x #":" 2))
+
+(defn nkv [x]
+  (let [[nmlkey val] (string/split x #"=" 2)]
+    (concat (nk nmlkey) (list val))))
+  
+(defn exe [tree commands]
   (if (empty? commands)
     tree
     (let [cmd (first commands)
           arg (second commands)
           rst (drop 2 commands)]
       (case cmd
-        "--get" (let [[nml key] (string/split arg #":")]
-                  (process (nmlget tree nml key) rst))
-        "--set" (println "### set!")))))
+        "--get" (let [[nml key    ] (nk  arg)] (exe (nmlget tree nml key)     rst))
+        "--set" (let [[nml key val] (nkv arg)] (exe (nmlset tree nml key val) rst))))))
 
 (defn -main [& args]
   (alter-var-root #'*read-eval* (constantly false))
   (let [commands (butlast args)
         filename (last args)
         tree (nmltree filename)]
-    (println (nmlstr (process tree commands)))))
+    (println (nmlstr (exe tree commands)))))

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

(defn nmlset [tree nml key val & sub]
  (let [child (if sub :nvsubseq :stmt)
        match (if sub key nml)

(defn fail [& msg]
  (if msg (println (apply str msg)))
  (System/exit 1))

(defn nmlname [x]
  (nmlstr (second x)))
