@@ -9,6 +9,7 @@ type command = [
99 | `Config
1010 | `Runtest of run_option
1111 | `Why3Config
12+ | `GenDoc of doc_option
1213]
1314
1415and options = {
@@ -24,7 +25,6 @@ and cmp_option = {
2425 cmpo_tstats : string option ;
2526 cmpo_noeco : bool ;
2627 cmpo_script : bool ;
27- cmpo_doc : bool ;
2828}
2929
3030and cli_option = {
@@ -41,6 +41,11 @@ and run_option = {
4141 runo_rawargs : string list ;
4242}
4343
44+ and doc_option = {
45+ doco_input : string ;
46+ doco_outdirp : string option ;
47+ }
48+
4449and prv_options = {
4550 prvo_maxjobs : int option ;
4651 prvo_timeout : int option ;
@@ -342,8 +347,7 @@ let specs = {
342347 `Spec (" tstats" , `String , " Save timing statistics to <file>" );
343348 `Spec (" script" , `Flag , " Computer-friendly output" );
344349 `Spec (" no-eco" , `Flag , " Do not cache verification results" );
345- `Spec (" compact" , `Int , " <internal>" );
346- `Spec (" doc" , `Flag , " Generate documentation" )]);
350+ `Spec (" compact" , `Int , " <internal>" )]);
347351
348352 (" cli" , " Run EasyCrypt top-level" , [
349353 `Group " loader" ;
@@ -361,6 +365,10 @@ let specs = {
361365 ]);
362366
363367 (" why3config" , " Configure why3" , [] );
368+
369+ (" gendoc" , " Generate documentation" , [
370+ `Spec (" odir" , `String , " Output documentation files in <dir>" )
371+ ]);
364372 ];
365373
366374 xp_groups = [
@@ -508,8 +516,7 @@ let cmp_options_of_values ini values input =
508516 cmpo_compact = get_int " compact" values;
509517 cmpo_tstats = get_string " tstats" values;
510518 cmpo_noeco = get_flag " no-eco" values;
511- cmpo_script = get_flag " script" values;
512- cmpo_doc = get_flag " doc" values; }
519+ cmpo_script = get_flag " script" values; }
513520
514521let runtest_options_of_values ini values (input , scenarios ) =
515522 { runo_input = input;
@@ -519,6 +526,10 @@ let runtest_options_of_values ini values (input, scenarios) =
519526 runo_jobs = get_int " jobs" values;
520527 runo_rawargs = get_strings " raw-args" values; }
521528
529+ let doc_options_of_values values input =
530+ { doco_input = input;
531+ doco_outdirp = get_string " odir" values; }
532+
522533(* -------------------------------------------------------------------- *)
523534let parse getini argv =
524535 let (command, values, anons) = parse specs argv in
@@ -578,8 +589,20 @@ let parse getini argv =
578589
579590 (cmd, ini, true )
580591
581- | _ -> assert false
592+ | "gendoc" ->
593+ begin
594+ match anons with
595+ | [input] ->
596+ let ini = getini None in
597+ let cmd = `GenDoc (doc_options_of_values values input) in
598+ (cmd, ini, true )
582599
600+ | _ ->
601+ raise (Arg. Bad " this command takes a single input file as argument" )
602+ end
603+
604+ | _ -> assert false
605+
583606 in {
584607 o_options = glb_options_of_values ~env ini values;
585608 o_command = command;
0 commit comments