Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 50e2f29f authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Single executable with subcommands

parent 03c13b9d
trustee-keygen belenios-tool
credgen
election-tool
...@@ -11,9 +11,6 @@ let native_compilation = ...@@ -11,9 +11,6 @@ let native_compilation =
let exe_suffix = if native_compilation then ".native" else ".byte" let exe_suffix = if native_compilation then ".native" else ".byte"
let exe_rule name =
copy_rule name ("src/bin/" ^ name ^ exe_suffix) name
let atdgen_action opts env build = let atdgen_action opts env build =
let x = env "%.atd" in let x = env "%.atd" in
let d = Pathname.dirname x and f = Pathname.basename x in let d = Pathname.dirname x and f = Pathname.basename x in
...@@ -49,9 +46,6 @@ let () = dispatch & function ...@@ -49,9 +46,6 @@ let () = dispatch & function
Cmd (S [A"markdown"; P (env "%.md"); Sh">"; P (env "%.html")]) Cmd (S [A"markdown"; P (env "%.md"); Sh">"; P (env "%.html")])
); );
(* binaries *) copy_rule "belenios-tool" ("src/bin/main" ^ exe_suffix) "belenios-tool";
exe_rule "credgen";
exe_rule "trustee-keygen";
exe_rule "election-tool";
| _ -> () | _ -> ()
...@@ -42,7 +42,7 @@ let speclist = Arg.([ ...@@ -42,7 +42,7 @@ let speclist = Arg.([
]) ])
let usage_msg = let usage_msg =
Printf.sprintf "Usage: %s [--dir <dir>] --uuid <uuid> {--count <n> | --file <file> | --derive <privcred>}" Sys.argv.(0) Printf.sprintf "Usage: %s credgen [--dir <dir>] --uuid <uuid> {--count <n> | --file <file> | --derive <privcred>}" Sys.argv.(0)
let anon_fun x = let anon_fun x =
Printf.eprintf "I do not know what to do with %s!\n" x; Printf.eprintf "I do not know what to do with %s!\n" x;
...@@ -184,6 +184,6 @@ ignore (option_map save hashed);; ...@@ -184,6 +184,6 @@ ignore (option_map save hashed);;
end end
let () = let main () =
let module X = RunCredgen (struct end) in let module X = RunCredgen (struct end) in
() ()
val main : unit -> unit
let usage () =
Printf.eprintf
"Usage: %s { trustee-keygen | election | credgen } options...\n"
Sys.argv.(0);
exit 1
let () =
let n = Array.length Sys.argv in
if n < 2 then usage ()
else (
Arg.current := 1;
match Sys.argv.(1) with
| "trustee-keygen" -> Tkeygen.main ()
| "election" -> Tool.main ()
| "credgen" -> Credgen.main ()
| _ -> usage ()
)
(* empty interface *)
...@@ -55,6 +55,6 @@ save privkey;; ...@@ -55,6 +55,6 @@ save privkey;;
end end
let () = let main () =
let module X = RunTrusteeKeygen (struct end) in let module X = RunTrusteeKeygen (struct end) in
() ()
val main : unit -> unit
...@@ -52,7 +52,7 @@ let speclist = Arg.([ ...@@ -52,7 +52,7 @@ let speclist = Arg.([
]) ])
let usage_msg = let usage_msg =
Printf.sprintf "Usage: %s [--dir <dir>] [--decrypt <privkey>]" Sys.argv.(0) Printf.sprintf "Usage: %s election [--dir <dir>] [--decrypt <privkey>]" Sys.argv.(0)
let anon_fun x = let anon_fun x =
Printf.eprintf "I do not know what to do with %s!\n" x; Printf.eprintf "I do not know what to do with %s!\n" x;
...@@ -228,7 +228,7 @@ let () = Printf.eprintf "All checks passed!\n%!" ...@@ -228,7 +228,7 @@ let () = Printf.eprintf "All checks passed!\n%!"
end end
let () = let main () =
let module P = GetParams(struct end) in let module P = GetParams(struct end) in
let module G = (val Election.finite_field P.group : Election.FF_GROUP) in let module G = (val Election.finite_field P.group : Election.FF_GROUP) in
let module X = RunTool (G) (P) in let module X = RunTool (G) (P) in
......
val main : unit -> unit
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment