#open "camlwin";;
#open "sys";;
 

if vect_length command_line < 3 
then ( print_string "\nUsage: onehelp ProjectName OutName"; print_newline () )
else 
(
  let project_file = open_in ((gr_without_suffix command_line.(1)) ^ ".prj")
  and out_file = open_out ((gr_without_suffix command_line.(2)) ^ ".html") in
    input_line project_file; (* skip identfier line *)
    try
    (
      while(true) do
        let file_name = input_line project_file in
          if gr_suffix_only file_name = "html"
          then 
          (
            let in_file = open_in file_name in
            print_string ("add file: " ^ file_name);
            print_newline ();
            try
              while(true) do output_string out_file ((input_line in_file) ^ "\n") done
            with End_of_file -> close_in in_file
          )
      done
    )
    with End_of_file -> close_out out_file; close_in project_file
);;

