[@@deriving]
plugin to generate Cmdliner sub-command groups, and ppx rewriter to generate Cmdliner evaluations.
ppx_subliner
can be installed via OCaml Package Manager.
$ opam install ppx_subliner
Please see the documentation.
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 *)