Commit 2269505c authored by MARCHE Claude's avatar MARCHE Claude
Browse files

option --extra-config in why3ide and why3session

parent a40863fc
......@@ -46,6 +46,7 @@ let opt_config = ref None
let opt_extra = ref []
let spec = Arg.align [
(*
("-L",
Arg.String (fun s -> includes := s :: !includes),
"<s> add s to loadpath") ;
......@@ -55,6 +56,7 @@ let spec = Arg.align [
("-I",
Arg.String (fun s -> includes := s :: !includes),
" same as -L (obsolete)") ;
*)
"-C", Arg.String (fun s -> opt_config := Some s),
"<file> Read configuration from <file>";
"--config", Arg.String (fun s -> opt_config := Some s),
......
......@@ -42,17 +42,19 @@ let print_usage () =
(Pp.print_iter1 Array.iter Pp.newline
(fun fmt e -> fprintf fmt "%s @[<hov>%s@]"
(Util.padd_string ' ' e.cmd_name maxl) e.cmd_desc)) cmds;
eprintf "detailed command options: %s <command> -help@." exec_name;
Arg.usage (Arg.align Why3session_lib.env_spec) "common options:";
eprintf "@\nspecific command options: %s <command> -help@." exec_name;
exit 1
let () =
if Array.length Sys.argv < 2 then print_usage ();
let cmd_name = Sys.argv.(1) in
match cmd_name with "-h" | "--help" -> print_usage ()
| "-v" | "--version" -> print_version ()
| _ -> ();
begin
match cmd_name with
| "-h" | "--help" -> print_usage ()
| "-v" | "--version" -> print_version (); exit 0
| _ -> ()
end;
let module M = struct exception Found of cmd end in
let cmd =
try
......
......@@ -39,7 +39,7 @@ let spec =
("-longtable",
Arg.Set opt_longtable,
" produce tables using longtable package instead of tabular") ::
simple_spec
env_spec
(* Statistics in LaTeX*)
......
......@@ -60,22 +60,28 @@ let read_simple_spec () =
let includes = ref []
let opt_config = ref None
let opt_loadpath = ref []
let opt_extra = ref []
let env_spec = [
let common_options = [
"-C", Arg.String (fun s -> opt_config := Some s),
"<file> Read configuration from <file>";
"--config", Arg.String (fun s -> opt_config := Some s),
" same as -C";
"--extra-config", Arg.String (fun s -> opt_extra := !opt_extra @ [s]),
"<file> Read additional configuration from <file>";
"-L", Arg.String (fun s -> opt_loadpath := s :: !opt_loadpath),
"<dir> Add <dir> to the library search path";
"--library", Arg.String (fun s -> opt_loadpath := s :: !opt_loadpath),
" same as -L";
]@simple_spec
]
let env_spec = common_options @ simple_spec
let read_env_spec () =
(** Configuration *)
let config = Whyconf.read_config !opt_config in
let config = List.fold_left Whyconf.merge_config config !opt_extra in
let main = Whyconf.get_main config in
Whyconf.load_plugins main;
let loadpath = (Whyconf.loadpath (Whyconf.get_main config))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment