We already support @enum syntax, but a simple variant type foo = Bar | Baz | Qux in a
{ foo: foo } should default to Cmdliner.Arg.(required & opt (some (enum [(Bar, "bar"; …)])) & info ["foo"])
from @smondet:
Another way could be:
type t = {
(* ... *)
my_option: [ `One | `Two [@name "second"] | `Three ] [@as_enum];
(* ... *)
]
that makes a Cmdliner enum: [ `One, "one"; `Two, "second"; `Three, "three" ]
We already support
@enumsyntax, but a simple varianttype foo = Bar | Baz | Quxin a{ foo: foo }should default toCmdliner.Arg.(required & opt (some (enum [(Bar, "bar"; …)])) & info ["foo"])from @smondet:
Another way could be:
that makes a Cmdliner enum:
[ `One, "one"; `Two, "second"; `Three, "three" ]