[ANN] ppx_subliner 0.2.0

I am very happy to announce the second release (v0.2.0) of ppx_subliner ! The new version is available through OPAM.

The extension had been greatly enhanced since the first release.

Now, the user is able to generate a multi-subcommand application from a single variant type with inline records. And the new version does not need to rely on other extensions.

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

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

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

The user is also able to generate Cmdliner.Term.t from a record type, and the signature is fully compatible with the generated value of ppx_deriving_cmdliner . The deriver support various attributes, such as [@pos], [@pos_all], [@pos_left], [@non_empty], [@conv], [@term], [@file], to support different kinds of positional arguments and types, and give the user great flexibility.

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

This release should cover majority of Cmdliner. Please see the documentation for the full feature set.

Happy hacking!

10 Likes