mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
52b1c25d50
The upside of this is that each command can define specific flags ; there is a small loss of backwards-compatibility in that the command needs to be the first argument. `catala --help` will now only show a summary of commands, with more specific manpages shown on `catala CMD --help`. Another point is that the plugin interface is extended to allow plugins to be registered as subcommands and have their own flags (this will be very useful for adding flags to the lazy/dot/explanation plugin that has many options). Note that no efforts has yet been made to specialise the options, the previous type was just made global for all subcommands.
37 lines
1.0 KiB
OCaml
37 lines
1.0 KiB
OCaml
open Catala_utils
|
|
open Driver
|
|
open Js_of_ocaml
|
|
|
|
let _ =
|
|
Js.export_all
|
|
(object%js
|
|
method interpret
|
|
(contents : Js.js_string Js.t)
|
|
(scope : Js.js_string Js.t)
|
|
(language : Js.js_string Js.t)
|
|
(trace : bool) =
|
|
driver `Interpret
|
|
(Contents (Js.to_string contents))
|
|
{
|
|
Cli.debug = false;
|
|
color = Never;
|
|
wrap_weaved_output = false;
|
|
avoid_exceptions = false;
|
|
plugins_dirs = [];
|
|
language = Some (Js.to_string language);
|
|
max_prec_digits = None;
|
|
closure_conversion = false;
|
|
message_format = Human;
|
|
trace;
|
|
disable_warnings = true;
|
|
disable_counterexamples = false;
|
|
optimize = false;
|
|
check_invariants = false;
|
|
ex_scope = Some (Js.to_string scope);
|
|
ex_variable = None;
|
|
output_file = None;
|
|
print_only_law = false;
|
|
link_modules = [];
|
|
}
|
|
end)
|