aboutsummaryrefslogtreecommitdiffstats
path: root/driver/CommonOptions.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2020-07-07 18:36:31 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2020-07-08 11:58:11 +0200
commit1a01ad629109cdb60fddae3787e3a589d20e9790 (patch)
tree02b0b37b65e12373b996bd109309d17b31408b44 /driver/CommonOptions.ml
parentae7eeb880d35fb12b4620e5320a8f9677a72d159 (diff)
downloadcompcert-kvx-1a01ad629109cdb60fddae3787e3a589d20e9790.tar.gz
compcert-kvx-1a01ad629109cdb60fddae3787e3a589d20e9790.zip
Use the same version string.
The version string dumped in the file should be the same as the version string printed by `-version`. The option is also not printed by `-help` since it is for internal use only.
Diffstat (limited to 'driver/CommonOptions.ml')
-rw-r--r--driver/CommonOptions.ml13
1 files changed, 3 insertions, 10 deletions
diff --git a/driver/CommonOptions.ml b/driver/CommonOptions.ml
index a2f249c1..e0e75e58 100644
--- a/driver/CommonOptions.ml
+++ b/driver/CommonOptions.ml
@@ -16,7 +16,7 @@ open Commandline
(* The version string for [tool_name] *)
let version_string tool_name =
if Version.buildnr <> "" && Version.tag <> "" && Version.branch <> "" then
- Printf.sprintf "The CompCert %s, Release: %s, Build: %s, Tag: %s, Branch %s\n"
+ Printf.sprintf "The CompCert %s\nVersion: %s\nBuild: %s\nTag: %s\nBranch: %s\n"
tool_name Version.version Version.buildnr Version.tag Version.branch
else
Printf.sprintf "The CompCert %s, version %s\n" tool_name Version.version
@@ -25,16 +25,10 @@ let version_string tool_name =
let print_version_and_exit tool_name () =
Printf.printf "%s" (version_string tool_name); exit 0
-let version_file_string tool_name =
- if Version.buildnr <> "" && Version.tag <> "" then
- Printf.sprintf "This is CompCert %s,\nVersion: %s,\nBuild: %s,\nTag: %s,\nBranch: %s\n"
- tool_name Version.version Version.buildnr Version.tag Version.branch
- else
- Printf.sprintf "The CompCert %s,\nversion %s\n" tool_name Version.version
-
+(* Print the version string to a file and exit the program *)
let print_version_file_and_exit tool_name file =
let oc = open_out_bin file in
- output_string oc (version_file_string tool_name);
+ output_string oc (version_string tool_name);
close_out_noerr oc;
exit 0
@@ -93,7 +87,6 @@ let general_help =
-v Print external commands before invoking them
-timings Show the time spent in various compiler passes
-version Print the version string and exit
- -version-file <file> Print version inforation to <file> and exit
-target <value> Generate code for the given target
-conf <file> Read configuration from file
@<file> Read command line options from <file>