A semi-advanced CLI example, built with ReasonML.
Clone this repository and cd
into it.
npm i -g esy@latest
esy
esy start -- --greet=<yourName>
esy start -- --help
esy test
File | Description |
---|---|
esy.json | If you're used to a NPM-like worfklow, esy.json is your package.json and specifies all dependencies and scripts. |
*/dune | The build system. Specify dependencies and more. Docs. |
src/cli.re | Our main library (dune). It's specified as a library to be able to be used for the tests as well. |
bin/app.re | Our main executable (dune). Uses our own made cli -library. |
tests/cli.re | Our only test file (dune). Uses our own made cli -library and OCaml-library alcotest as our testrunner. |
cli.opam | Needed for dune to pick up src/cli.re as a libary. |
- Alcotest (OCaml) - Test runner
- Pastel (ReasonML) - JSX-like text-coloring and text-formatting
- Console (ReasonML) - Javascript-like logger
- Refmterr (ReasonML) - Pretty printing for error-messages
- Tablecloth (Reasonml/OCaml) - One of a few base-libraries