We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We already support @enum syntax, but a simple variant type foo = Bar | Baz | Qux in a
@enum
type foo = Bar | Baz | Qux
{ foo: foo } should default to Cmdliner.Arg.(required & opt (some (enum [(Bar, "bar"; …)])) & info ["foo"])
{ foo: foo }
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" ]
[ `One, "one"; `Two, "second"; `Three, "three" ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We already support
@enum
syntax, but a simple varianttype foo = Bar | Baz | Qux
in 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" ]
The text was updated successfully, but these errors were encountered: