let iter_tags f x =
let rec spec x =
match x with
| N | A _ | Sh _ | P _ | Px _ | V _ | Quote _ -> ()
| S l -> List.iter spec l
| T tags -> f tags
in
let rec cmd x =
match x with
| Nop | Echo _ -> ()
| Cmd(s) -> spec s
| Seq(s) -> List.iter cmd s in
cmd x