@@ -9,6 +9,7 @@ type command = [
9
9
| `Config
10
10
| `Runtest of run_option
11
11
| `Why3Config
12
+ | `GenDoc of doc_option
12
13
]
13
14
14
15
and options = {
@@ -24,7 +25,6 @@ and cmp_option = {
24
25
cmpo_tstats : string option ;
25
26
cmpo_noeco : bool ;
26
27
cmpo_script : bool ;
27
- cmpo_doc : bool ;
28
28
}
29
29
30
30
and cli_option = {
@@ -41,6 +41,11 @@ and run_option = {
41
41
runo_rawargs : string list ;
42
42
}
43
43
44
+ and doc_option = {
45
+ doco_input : string ;
46
+ doco_outdirp : string option ;
47
+ }
48
+
44
49
and prv_options = {
45
50
prvo_maxjobs : int option ;
46
51
prvo_timeout : int option ;
@@ -342,8 +347,7 @@ let specs = {
342
347
`Spec (" tstats" , `String , " Save timing statistics to <file>" );
343
348
`Spec (" script" , `Flag , " Computer-friendly output" );
344
349
`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>" )]);
347
351
348
352
(" cli" , " Run EasyCrypt top-level" , [
349
353
`Group " loader" ;
@@ -361,6 +365,10 @@ let specs = {
361
365
]);
362
366
363
367
(" why3config" , " Configure why3" , [] );
368
+
369
+ (" gendoc" , " Generate documentation" , [
370
+ `Spec (" odir" , `String , " Output documentation files in <dir>" )
371
+ ]);
364
372
];
365
373
366
374
xp_groups = [
@@ -508,8 +516,7 @@ let cmp_options_of_values ini values input =
508
516
cmpo_compact = get_int " compact" values;
509
517
cmpo_tstats = get_string " tstats" values;
510
518
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; }
513
520
514
521
let runtest_options_of_values ini values (input , scenarios ) =
515
522
{ runo_input = input;
@@ -519,6 +526,10 @@ let runtest_options_of_values ini values (input, scenarios) =
519
526
runo_jobs = get_int " jobs" values;
520
527
runo_rawargs = get_strings " raw-args" values; }
521
528
529
+ let doc_options_of_values values input =
530
+ { doco_input = input;
531
+ doco_outdirp = get_string " odir" values; }
532
+
522
533
(* -------------------------------------------------------------------- *)
523
534
let parse getini argv =
524
535
let (command, values, anons) = parse specs argv in
@@ -578,8 +589,20 @@ let parse getini argv =
578
589
579
590
(cmd, ini, true )
580
591
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 )
582
599
600
+ | _ ->
601
+ raise (Arg. Bad " this command takes a single input file as argument" )
602
+ end
603
+
604
+ | _ -> assert false
605
+
583
606
in {
584
607
o_options = glb_options_of_values ~env ini values;
585
608
o_command = command;
0 commit comments