package pplumbing
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=469a458f9b70980d114a7548b1b0e3b08515da313456662e9b51bfdabc0c353c
sha512=56bbc7b0fbe9132aa0fd694eea7957530161d63ccf3e8f4cf0956d26660d0743591a5d6d642af4ae9b3f9635986679f1733c7eb57acd7da434dc9d448497ec22
Description
[pplumbing] defines a set of utility libraries to use with pp. It is compatible with logs and inspired by design choices used by dune for user messages:
-
[Pp_tty] extends pp to build colored documents in the user's terminal using ansi escape codes.
-
[Err] is an abstraction to report located errors and warnings to the user.
-
[Log] is an interface to logs using [Pp_tty] rather than [Format].
-
[Log_cli] contains functions to work with [Err] on the side of end programs (such as a command line tool). It defines command line helpers to configure the [Err] library, while taking care of setting the logs and fmt style rendering.
-
[Cmdlang_cmdliner_runner] is a library for running command line programs specified with cmdlang with cmdliner as a backend and making opinionated choices, assuming your dependencies are using [Err].
These libraries are meant to combine nicely into a small ecosystem of useful helpers to build CLIs in OCaml.
README
pplumbing

pplumbing defines a set of utility libraries to use with pp
. It is compatible with logs
and inspired by design choices used by Dune for user messages:
Pp_tty
extendspp
to build colored documents in the user's terminal using ANSI escape codes.Err
is an abstraction to report located errors and warnings to the user.Log
is an interface tologs
usingPp_tty
rather thanFormat
.Log_cli
contains functions to work withErr
on the side of end programs (such as a command line tools). It defines command line helpers to configure theErr
library, while taking care of setting thelogs
andfmt
style rendering.Cmdlang_cmdliner_runner
is a library for running command line programs specified withcmdlang
withcmdliner
as a backend and making opinionated choices, assuming your dependencies are usingErr
.
These libraries are meant to combine nicely into a small ecosystem of useful helpers to build CLIs in OCaml.
Links to plumbed projects
Acknowledgements
- We are thankful to the authors and contributors of the projects we use as dependencies.
- We would like to thank the Dune developers for the user-facing error handling of Dune (
Stdune.User_message
), on which we based the error handling scheme used inErr
. By adopting a similar approach, we aim to provide a consistent and unified user experience for OCaml users across different tools and libraries.