@@ -25,26 +25,9 @@ let version_string tool_name =
2525let print_version_and_exit tool_name () =
2626 Printf. printf " %s" (version_string tool_name); exit 0
2727
28- let version_file_string tool_name =
29- if Version. buildnr <> " " && Version. tag <> " " then
30- Printf. sprintf " This is CompCert %s\n Version: %s\n Build: %s\n Tag: %s\n Branch: %s\n "
31- tool_name Version. version Version. buildnr Version. tag Version. branch
32- else
33- Printf. sprintf " The CompCert %s,\n version %s\n " tool_name Version. version
34-
35- (* Print the version string to a file and exit the program *)
36- let print_version_file_and_exit tool_name file =
37- let oc = open_out_bin file in
38- output_string oc (version_file_string tool_name);
39- close_out_noerr oc;
40- exit 0
41-
4228let version_options tool_name =
4329 [ Exact " -version" , Unit (print_version_and_exit tool_name);
44- Exact " --version" , Unit (print_version_and_exit tool_name);
45- Exact " -version-file" , String (print_version_file_and_exit tool_name);
46- Exact " --version-file" , String (print_version_file_and_exit tool_name);
47- ]
30+ Exact " --version" , Unit (print_version_and_exit tool_name) ]
4831
4932(* Language support options *)
5033
@@ -105,4 +88,4 @@ let general_options =
10588 Exact " -target" , Ignore ;(* Ignore option since it is already handled *)
10689 Exact " -v" , Set option_v;
10790 Exact " -stdlib" , String (fun s -> stdlib_path := s);
108- Exact " -timings" , Set option_timings; ]
91+ Exact " -timings" , Set option_timings ]
0 commit comments