package pplumbing

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file cmdlang_cmdliner_runner.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let run ?exn_handler cmd ~name ~version =
  match
    Err.protect ?exn_handler (fun () ->
      Cmdliner.Cmd.eval
        ~catch:false
        (Cmdlang_to_cmdliner.Translate.command cmd ~name ~version))
  with
  | Ok code | Error code ->
    (* We allow the function to terminate normally when [code=0]. This is
       because [bisect_ppx] instruments the out-edge of calls to [run] in
       executables. If we never return, it would create false negatives in test
       coverage. We may revisit this decision in the future if the context
       changes. *)
    if code <> 0 then exit code
;;
OCaml

Innovation. Community. Security.