Skip to content

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

License

Notifications You must be signed in to change notification settings

bn-d/ppx_subliner

Repository files navigation

[@@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 *)

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages