Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.5 KB

README.md

File metadata and controls

43 lines (31 loc) · 1.5 KB

[@@deriving subliner] and [%%subliner]

OCaml CI GitHub release status Coverage Status

[@@deriving] plugin to generate Cmdliner sub-command groups, and ppx rewriter to generate Cmdliner evaluations.

Installation

ppx_subliner can be installed via OCaml Package Manager.

$ opam install ppx_subliner

Usage

Please see the documentation.

Example

type foo = { my_arg : string } [@@deriving subliner]

type params = Foo of foo | Bar | Foobar of { my_arg : string }
[@@deriving subliner]

let handle = function
  | Foo { my_arg } -> print_endline ("Foo " ^ my_arg)
  | Bar -> print_endline "Bar"
  | Foobar { my_arg } -> print_endline ("Foobar" ^ my_arg)

[%%subliner.cmds
eval.params <- handle]
(** Some docs *)