123456789101112131415161718192021(*********************************************************************************)(* pplumbing - Utility libraries to use with [pp] *)(* SPDX-FileCopyrightText: 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* SPDX-License-Identifier: MIT *)(*********************************************************************************)letrun?exn_handlercmd~name~version=matchErr.protect?exn_handler(fun()->Cmdliner.Cmd.eval~catch:false(Cmdlang_to_cmdliner.Translate.commandcmd~name~version))with|Okcode|Errorcode->(* 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. *)ifcode<>0thenexitcode;;