feat: add --version flag

This commit is contained in:
Simon Cruanes 2019-12-09 11:55:45 -06:00
parent 10cfa137b6
commit c63887a1f0
2 changed files with 12 additions and 0 deletions

View file

@ -8,4 +8,15 @@
sidekick.msat-solver sidekick-bin.smtlib)
(flags :standard -safe-string -color always -open Sidekick_util))
(rule
(targets sidekick_version.ml)
(deps (universe))
(mode promote)
(action
(with-stdout-to %{targets}
(progn
(echo "let version = {git|")
(run git rev-parse HEAD)
(echo "|git}")))))
(ocamllex (modules Dimacs_lexer))

View file

@ -78,6 +78,7 @@ let argspec = Arg.align [
"--no-p", Arg.Clear p_progress, " no progress bar";
"--size", Arg.String (int_arg size_limit), " <s>[kMGT] sets the size limit for the sat solver";
"--time", Arg.String (int_arg time_limit), " <t>[smhd] sets the time limit for the sat solver";
"--version", Arg.Unit (fun () -> Printf.printf "version: %s\n%!" Sidekick_version.version; exit 0), " show version and exit";
"-d", Arg.Int Msat.Log.set_debug, "<lvl> sets the debug verbose level";
"--debug", Arg.Int Msat.Log.set_debug, "<lvl> sets the debug verbose level";
] |> List.sort compare