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

Single executable with subcommands

parent 03c13b9d
trustee-keygen
credgen
election-tool
belenios-tool
......@@ -11,9 +11,6 @@ let native_compilation =
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 x = env "%.atd" in
let d = Pathname.dirname x and f = Pathname.basename x in
......@@ -49,9 +46,6 @@ let () = dispatch & function
Cmd (S [A"markdown"; P (env "%.md"); Sh">"; P (env "%.html")])
);
(* binaries *)
exe_rule "credgen";
exe_rule "trustee-keygen";
exe_rule "election-tool";
copy_rule "belenios-tool" ("src/bin/main" ^ exe_suffix) "belenios-tool";
| _ -> ()
......@@ -42,7 +42,7 @@ let speclist = Arg.([
])
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 =
Printf.eprintf "I do not know what to do with %s!\n" x;
......@@ -184,6 +184,6 @@ ignore (option_map save hashed);;
end
let () =
let main () =
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;;
end
let () =
let main () =
let module X = RunTrusteeKeygen (struct end) in
()
val main : unit -> unit
......@@ -52,7 +52,7 @@ let speclist = Arg.([
])
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 =
Printf.eprintf "I do not know what to do with %s!\n" x;
......@@ -228,7 +228,7 @@ let () = Printf.eprintf "All checks passed!\n%!"
end
let () =
let main () =
let module P = GetParams(struct end) in
let module G = (val Election.finite_field P.group : Election.FF_GROUP) 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