let read_rc_file file =
  try
    let chanin = open_in file in
    let line = ref 0 in
    let rec f () =
      let s_opt = 
        try Some (input_line chanin)
        with End_of_file -> None
      in
      match s_opt with
        None -> ()
      | Some s -> 
          (
           try
             let n = String.index s ':' in
             let before = String.sub s 0 n in
             let len = String.length s in
             let after = 
               if n + 1 >= len 
               then "" 
               else String.sub s (n+1) (len - n - 1)
             in
             let r = 
               match Ocvs_misc.chop_whitespace before 0 with
                 "add" -> add_options
               | "commit" -> commit_options
               | "remove" -> remove_options
               | "status" -> status_options
               | "update" -> update_options
               | _ -> ref ""
             in
             r := after
           with
             Not_found ->
               prerr_endline (Ocvs_messages.error_invalid_syntax file !line s)
          );
          incr line ;
          f ()
    in
    f () ;
    close_in chanin
  with
    Sys_error s -> 
      prerr_endline s ;
      ()