Skip to content

Commit

Permalink
trace output: use a file argument instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Jan 8, 2025
1 parent c094ac6 commit c9ce9fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions compiler/catala_utils/cli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ module Flags = struct

let trace_output =
value
& opt (some string) None
& opt (some raw_file) None
& info ["trace-output"] ~docv:"FILE"
~doc:
"Output trace logs to the specified file instead of stdout. Works \
Expand Down Expand Up @@ -260,11 +260,12 @@ module Flags = struct
| "-" -> "-"
| f -> File.reverse_path ~to_dir f)
in
let trace_output = Option.map path_rewrite trace_output in
(* This sets some global refs for convenience, but most importantly
returns the options record. *)
Global.enforce_options ~language ~debug ~color ~message_format ~trace
~trace_format ~trace_output ~plugins_dirs ~disable_warnings ~max_prec_digits
~path_rewrite ~stop_on_error ~no_fail_on_assert ()
~trace_format ~trace_output ~plugins_dirs ~disable_warnings
~max_prec_digits ~path_rewrite ~stop_on_error ~no_fail_on_assert ()
in
Term.(
const make
Expand Down
2 changes: 1 addition & 1 deletion compiler/catala_utils/global.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type options = {
mutable path_rewrite : raw_file -> file;
mutable stop_on_error : bool;
mutable no_fail_on_assert : bool;
mutable trace_output : string option;
mutable trace_output : file option;
}

(* Note: we force that the global options (ie options common to all commands)
Expand Down

0 comments on commit c9ce9fe

Please sign in to comment.