dune icon indicating copy to clipboard operation
dune copied to clipboard

Upgrade cmdliner fork to 1.1.1

Open emillon opened this issue 2 years ago • 3 comments

We still need a fork to support alias but this brings the upstream part to 1.1.1. The main addition is builtin support of groups through the Cmdliner.Cmd API.

Benefits include:

  • we get closer to upstream cmdliner
  • help pages like dune ocaml --help are now more useful

This commit contains several things:

  • an update of the vendored copy (to be reviewed separately),
  • a port of bin/ to the Cmdliner.Cmd API,
  • test updates, mostly typographic.

emillon avatar Aug 04 '22 13:08 emillon

I'll put comments with places to discuss. The PR on cmdliner is https://github.com/ocaml-dune/cmdliner/pull/1.

emillon avatar Aug 04 '22 13:08 emillon

Actually, regarding displaying command names or not, this is a feature that we introduced in our fork to implement groups in #3936. So it's not a regression in cmdliner. I'd rather keep the vanilla cmdliner code rather than patch it to keep the behaviour we introduced.

To clarify, it means that the first line of the message if

dune: TARGET... arguments: unclosed parenthesis at end of input

rather than

dune build: TARGET... arguments: unclosed parenthesis at end of input

but it's ok since the following lines are

Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.

emillon avatar Sep 22 '22 14:09 emillon

I'm in favor of dropping the command name patch since it doesn't hinder the error message and is easier to maintain.

Alizter avatar Sep 22 '22 14:09 Alizter

Thanks! I've closed the cmdliner issue, will merge the ocaml-dune/cmdliner PR, and take care of the rest here.

emillon avatar Sep 23 '22 11:09 emillon