diff --git a/sledge/bin/version.ml b/sledge/bin/version.ml index e1719fac3..3782af8ad 100644 --- a/sledge/bin/version.ml +++ b/sledge/bin/version.ml @@ -14,19 +14,23 @@ let debug = true ) ; !d -module B = Build_info.V1 +module Build_info = Build_info.V1 let version_to_string v = - Option.value_map ~f:B.Version.to_string v ~default:"dev" + Option.value_map ~f:Build_info.Version.to_string v ~default:"dev" let version = - version_to_string (B.version ()) ^ if debug then "-dbg" else "" + Format.sprintf "%s%s" + (version_to_string (Build_info.version ())) + (if debug then "-dbg" else "") let build_info = let libs = - List.map (B.Statically_linked_libraries.to_list ()) ~f:(fun lib -> - ( B.Statically_linked_library.name lib - , version_to_string (B.Statically_linked_library.version lib) ) ) + List.map (Build_info.Statically_linked_libraries.to_list ()) + ~f:(fun lib -> + ( Build_info.Statically_linked_library.name lib + , version_to_string + (Build_info.Statically_linked_library.version lib) ) ) |> List.sort ~compare:[%compare: string * string] in let max_length = @@ -34,9 +38,9 @@ let build_info = max n (String.length name) ) in String.concat ~sep:"\n" - ( "ocaml:" - :: Sys.ocaml_version + ( Printf.sprintf "%-*s %s" (max_length + 2) "ocaml:" Sys.ocaml_version :: "statically linked libraries:" :: List.map libs ~f:(fun (name, v) -> Printf.sprintf "- %-*s %s" max_length name v ) - @ ["version:"] ) + @ [Printf.sprintf "%-*s %b" (max_length + 2) "debug:" debug; "version:"] + )