From 1a01ad629109cdb60fddae3787e3a589d20e9790 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 7 Jul 2020 18:36:31 +0200 Subject: 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. --- driver/CommonOptions.ml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'driver/CommonOptions.ml') 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 Print version inforation to and exit -target Generate code for the given target -conf Read configuration from file @ Read command line options from -- cgit