Skip to content
New issue

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

List enum value in help, optionally. #15

Open
smondet opened this issue Mar 10, 2017 · 0 comments
Open

List enum value in help, optionally. #15

smondet opened this issue Mar 10, 2017 · 0 comments

Comments

@smondet
Copy link
Member

smondet commented Mar 10, 2017

Like cmdliner, we don't list enum values in the help:

ocaml# type t = { foo: string [@enum ["a", "b"]] [@docv "FOO"];(** Hello *) } [@@deriving cmdliner];;
type t = { foo : string; }
val cmdliner_term : unit -> t Cmdliner.Term.t = <fun>
ocaml# Cmdliner.Term.(eval ~argv:[| "hello"; "--help=plain" |] (cmdliner_term (), info "hello"));;
NAME
        hello
SYNOPSIS
       hello [OPTION]... 

OPTIONS
       --foo=FOO (required)
            Hello 

       --help[=FMT] (default=auto)
           Show this help in format FMT. The value FMT must be one of `auto',
           `pager', `groff' or `plain'. With `auto', the format is `pager` or
           `plain' whenever the TERM env var is `dumb' or undefined.

- : t Cmdliner.Term.result = `Help

It'd be cool to have an option

type t = {
   foo: string [@enum ["a", "b"]] [@docv "FOO"] [@cmdliner.list_enum];
   (** Some help *)
} [@@deriving cmdliner];;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants