Explorar el Código

added --each support

Nicolas Cannasse hace 13 años
padre
commit
9293d08174
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      main.ml

+ 5 - 1
main.ml

@@ -387,17 +387,21 @@ let create_context params =
 	ctx
 
 let rec process_params create pl =
+	let each_params = ref [] in
 	let rec loop acc = function
 		| [] ->
 			let ctx = create (List.rev acc) in
 			init ctx;
 			ctx.flush()
 		| "--next" :: l ->
-			let ctx = create (List.rev acc) in
+			let ctx = create (!each_params @ (List.rev acc)) in
 			ctx.has_next <- true;
 			init ctx;
 			ctx.flush();
 			loop [] l
+		| "--each" :: l ->
+			each_params := List.rev acc;
+			loop [] l
 		| "--cwd" :: dir :: l ->
 			(* we need to change it immediately since it will affect hxml loading *)
 			(try Unix.chdir dir with _ -> ());