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

Create "the main entry point" [@@cmdliner.eval params] #20

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

Create "the main entry point" [@@cmdliner.eval params] #20

smondet opened this issue Mar 17, 2017 · 0 comments

Comments

@smondet
Copy link
Member

smondet commented Mar 17, 2017

Not sure this is a good idea; but this could simplify simple cases further.

Like in the example:

type params = {
   (* ... *)
} [@@deriving cmdliner]
let my_main params =
   (* do stuff *)
let () =
  let term = Cmdliner.Term.(const my_main $ params_cmdliner_term ()) in
  let info = Cmdliner.Term.info Sys.argv.(0) in
  Cmdliner.Term.eval (term, info)

could be:

type params = {
   (* ... *)
} [@@deriving cmdliner]
let my_main params [@@deriving.eval_with params] =
   (* do stuff *)

and the let () would be generated.

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