From 430263226793599834da40a39b2f82565338bd70 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 8 Jul 2020 16:51:22 +0200 Subject: Revert "Use the same version string." This reverts commit 1a01ad629109cdb60fddae3787e3a589d20e9790. --- driver/CommonOptions.ml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'driver/CommonOptions.ml') diff --git a/driver/CommonOptions.ml b/driver/CommonOptions.ml index e0e75e58..a2f249c1 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\nVersion: %s\nBuild: %s\nTag: %s\nBranch: %s\n" + Printf.sprintf "The CompCert %s, Release: %s, Build: %s, Tag: %s, Branch %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,10 +25,16 @@ let version_string tool_name = let print_version_and_exit tool_name () = Printf.printf "%s" (version_string tool_name); exit 0 -(* Print the version string to a file and exit the program *) +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 + let print_version_file_and_exit tool_name file = let oc = open_out_bin file in - output_string oc (version_string tool_name); + output_string oc (version_file_string tool_name); close_out_noerr oc; exit 0 @@ -87,6 +93,7 @@ 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