search for: set_machine_readable

Displaying 5 results from an estimated 5 matches for "set_machine_readable".

2018 Aug 21
0
[PATCH 2/2] OCaml tools: add output selection for --machine-readable
...lse) ?(machine_readable = false) usage_msg = (** Install an exit hook to check gc consistency for --debug-gc *) let set_debug_gc () = at_exit (fun () -> Gc.compact()) in + let parse_machine_readable = function + | None -> + machine_readable_output := Channel stdout; + set_machine_readable () + | Some fmt -> + let outtype, outname = String.split ":" fmt in + if outname = "" then + error (f_"invalid format string for --machine-readable: %s") fmt; + (match outtype with + | "file" -> machine_readable_output := F...
2018 Aug 20
2
[PATCH 1/2] mlstdutils/mltools: factorize the machine-readable option
...tils.ml b/common/mlstdutils/std_utils.ml index df443058f..6499b3535 100644 --- a/common/mlstdutils/std_utils.ml +++ b/common/mlstdutils/std_utils.ml @@ -645,6 +645,10 @@ let verbose = ref false let set_verbose () = verbose := true let verbose () = !verbose +let machine_readable = ref false +let set_machine_readable () = machine_readable := true +let machine_readable () = !machine_readable + let with_open_in filename f = let chan = open_in filename in protect ~f:(fun () -> f chan) ~finally:(fun () -> close_in chan) diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli inde...
2018 Aug 21
4
[PATCH 0/2] RFC: add output selection for --machine-readable
Hi, this is a first approach (hence RFC, since it misses tests & documentation) in selecting the output for --machine-readable. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it
2018 Aug 23
0
[PATCH v2 2/2] OCaml tools: add output selection for --machine-readable
...tils.ml b/common/mlstdutils/std_utils.ml index 6499b3535..df443058f 100644 --- a/common/mlstdutils/std_utils.ml +++ b/common/mlstdutils/std_utils.ml @@ -645,10 +645,6 @@ let verbose = ref false let set_verbose () = verbose := true let verbose () = !verbose -let machine_readable = ref false -let set_machine_readable () = machine_readable := true -let machine_readable () = !machine_readable - let with_open_in filename f = let chan = open_in filename in protect ~f:(fun () -> f chan) ~finally:(fun () -> close_in chan) diff --git a/common/mlstdutils/std_utils.mli b/common/mlstdutils/std_utils.mli inde...
2018 Aug 23
3
[PATCH v2 0/2] add output selection for --machine-readable
Hi, this adds the possibility to select the output for --machine-readable in OCaml tools. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it possible to add additional output for