| _ ->
failwith "bah"
+exception Unknown_boolean of string
+
let string_of_string_option opt = match opt with None -> "" | Some v -> v
let string_option_of_string s = match s with "" -> None | _ -> Some s
let string_of_int_option opt = match opt with None -> "" | Some v -> string_of_int v
let int_option_of_string s = if s = "" then None else Some (int_of_string s)
+let bool_of_string s =
+ match (String.lowercase s) with
+ | "1" | "y" | "yes" | "true" -> true
+ | "0" | "n" | "no" | "false" -> false
+ | _ -> raise (Unknown_boolean s)
exception Unknown_field of string