let already_configured s l =
List.for_all (fun item -> List.exists (fun x -> x = item) l) s
+let tilde_expand_key k =
+ try
+ Helm_registry.set k (HExtlib.tilde_expand (Helm_registry.get k))
+ with Helm_registry.Key_not_found _ -> ()
+
let load_configuration init_status =
if not (already_configured [ConfigurationFile] init_status) then
begin
Helm_registry.load_from BuildTimeConf.matita_conf;
+ if not (Helm_registry.has "user.name") then begin
+ let login = (Unix.getpwuid (Unix.getuid ())).Unix.pw_name in
+ Helm_registry.set "user.name" login
+ end;
+ tilde_expand_key "matita.basedir";
+ tilde_expand_key "user.home";
ConfigurationFile::init_status
end
else
"matita.external_editor", "gvim -f -c 'go %p' %f";
"matita.preserve", "false";
"matita.quiet", "false";
+ "matita.profile", "true";
]
let set_registry_values =
"-nodb", Arg.Unit (fun () -> Helm_registry.set_bool "db.nodb" true),
("Avoid using external database connection "
^ "(WARNING: disable many features)");
+ "-noprofile",
+ Arg.Unit (fun () -> Helm_registry.set_bool "matita.profile" false),
+ "Turns off profiling printings";
] in
let debug_arg_spec =
if BuildTimeConf.debug then
Arg.parse arg_spec (add_l args) (usage ());
set_list ~key:"matita.includes" includes;
set_list ~key:"matita.args" args;
+ HExtlib.set_profiling_printings
+ (fun () -> Helm_registry.get_bool "matita.profile");
CmdLine :: init_status
end else
init_status