[buck] Add --version-vcs option

Reviewed By: jvillard

Differential Revision: D3993889

fbshipit-source-id: c4d61a3
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent 81344f016e
commit f889479748

@ -1142,6 +1142,10 @@ and version_json =
~exes:CLOpt.[Analyze;Clang;Java;Print] ~exes:CLOpt.[Analyze;Clang;Java;Print]
"Print version json formatted" "Print version json formatted"
and version_vcs =
CLOpt.mk_bool ~long:"version-vcs"
~exes:CLOpt.[Analyze;Clang;Java;Print] "Print version control system commit and exit"
and whole_seconds = and whole_seconds =
CLOpt.mk_bool ~deprecated:["whole_seconds"] ~long:"whole-seconds" CLOpt.mk_bool ~deprecated:["whole_seconds"] ~long:"whole-seconds"
"Print whole seconds only" "Print whole seconds only"
@ -1258,6 +1262,10 @@ let post_parsing_initialization () =
F.fprintf F.std_formatter "%s@." Version.versionJson ; F.fprintf F.std_formatter "%s@." Version.versionJson ;
exit 0 exit 0
); );
if !version_vcs then (
F.fprintf F.std_formatter "%s@." Version.commit ;
exit 0
);
let set_minor_heap_size nMb = (* increase the minor heap size to speed up gc *) let set_minor_heap_size nMb = (* increase the minor heap size to speed up gc *)
let ctrl = Gc.get () in let ctrl = Gc.get () in

@ -9,5 +9,6 @@
open! Utils open! Utils
val commit : string
val versionString : string val versionString : string
val versionJson : string val versionJson : string

Loading…
Cancel
Save