From: <hez...@us...> - 2009-09-21 01:59:11
|
Revision: 10444 http://plplot.svn.sourceforge.net/plplot/?rev=10444&view=rev Author: hezekiahcarty Date: 2009-09-21 01:59:00 +0000 (Mon, 21 Sep 2009) Log Message: ----------- touchup.ml now takes (optional) command-line arguments for input and output Modified Paths: -------------- trunk/bindings/ocaml/touchup.ml Modified: trunk/bindings/ocaml/touchup.ml =================================================================== --- trunk/bindings/ocaml/touchup.ml 2009-09-21 01:42:07 UTC (rev 10443) +++ trunk/bindings/ocaml/touchup.ml 2009-09-21 01:59:00 UTC (rev 10444) @@ -427,10 +427,17 @@ close_out fout; () -(** Given "file", write out "file.inc" which should be ready for consumption by - camlidl. *) -let process_file filename = - read_file filename +(** Given input and output filenames, process the contents of the input file + and write the results to the output file, which should be ready for + consumption by camlidl. *) +let process_file () = + let infile, outfile = + if Array.length Sys.argv = 3 then + Sys.argv.(1), Sys.argv.(2) + else + "plplot_h", "plplot_h.inc" + in + read_file infile |> cleanup_lines |> Pcre.split ~pat:"\n" |> List.map minimize_whitespace @@ -444,11 +451,11 @@ ) |> List.map minimize_whitespace |> List.map (fun l -> l ^ "\n") - |> write_file (filename ^ ".inc") + |> write_file outfile let () = if !Sys.interactive then () else - process_file "plplot_h"; + process_file (); () This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |