The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Track B0_testing

+21 -17
+21 -17
vendor/opam/cmdliner/test/test_man.ml
··· 383 383 384 384 let main () = 385 385 let doc = "Test manpage specifications" in 386 - let test_help = 387 - let doc = "Test manpage interactively as if --help[$(docv)] is invoked" in 388 - let help_fmts = 389 - ["auto", "=auto"; "pager", "=pager"; "groff", "=groff"; 390 - "plain", "=plain"; "", ""] 386 + let main = 387 + let open Cmdliner.Term.Syntax in 388 + let+ test_help = 389 + let doc = "Test manpage interactively as if --help[$(docv)] is invoked" in 390 + let help_fmts = 391 + ["auto", "=auto"; "pager", "=pager"; "groff", "=groff"; 392 + "plain", "=plain"; "", ""] 393 + in 394 + let help_enum = Cmdliner.Arg.enum help_fmts and docv = "FMT" in 395 + Arg.(value & opt ~vopt:(Some "") (some help_enum) None & 396 + info ["test-help"] ~docv ~doc) 391 397 in 392 - let help_enum = Cmdliner.Arg.enum help_fmts and docv = "FMT" in 393 - Arg.(value & opt ~vopt:(Some "") (some help_enum) None & 394 - info ["test-help"] ~docv ~doc) 398 + fun () -> match test_help with 399 + | None -> 400 + Test.log "Invoke with %a[=FMT] to test %a[=FMT] interactively" 401 + Fmt.code "--test-help" Fmt.code "--help"; 402 + Test.autorun () 403 + | Some fmt -> 404 + Test.set_main_exit @@ fun () -> 405 + let argv = Array.of_list (Cmd.name cmd :: ["--help" ^ fmt ]) in 406 + Cmd.eval ~argv (Cmd.v info man_test_t) 395 407 in 396 - Test.main' test_help ~doc @@ function 397 - | None -> 398 - Test.log "Invoke with %a[=FMT] to test %a[=FMT] interactively" 399 - Fmt.code "--test-help" Fmt.code "--help"; 400 - Test.autorun () 401 - | Some fmt -> 402 - Test.set_main_exit @@ fun () -> 403 - let argv = Array.of_list (Cmd.name cmd :: ["--help" ^ fmt ]) in 404 - Cmd.eval ~argv (Cmd.v info man_test_t) 408 + Test.main' ~doc main 405 409 406 410 let () = if !Sys.interactive then () else exit (main ())