Skip to content

Update vendored cmdliner to 2.1.1#14636

Open
ElectreAAS wants to merge 4 commits into
ocaml:mainfrom
ElectreAAS:push-ypyxsntwwwmk
Open

Update vendored cmdliner to 2.1.1#14636
ElectreAAS wants to merge 4 commits into
ocaml:mainfrom
ElectreAAS:push-ypyxsntwwwmk

Conversation

@ElectreAAS
Copy link
Copy Markdown
Collaborator

@ElectreAAS ElectreAAS commented May 21, 2026

Fixes #12515.
This PR pulls in all the changes from cmdliner 2.1.1, see changelog here.
Among these changes, there are new error messages formats, so that's a big diff on that commit.
On top of the released cmdliner, there is a singular patch to keep support for aliases.
This has the non-insignificant bonus of simplifying maintenance of our fork over at https://github.com/ocaml-dune/cmdliner

Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
Comment thread vendor/update-cmdliner.sh
| Error err -> err::errs,args
let cline = Cmdliner_def.Cline.add arg_info arg cline in
let errs, args =
match Cmdliner_def.Arg_info.alias arg_info name value with
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
match Cmdliner_def.Arg_info.alias arg_info name value with
if for_completion then errs, args
else match Cmdliner_def.Arg_info.alias arg_info name value with

We probably don't want to expand these when doing completion.

It doesn't have to be in this PR, but I thought I'd point it out anyway.

Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
@ElectreAAS ElectreAAS force-pushed the push-ypyxsntwwwmk branch from 5935221 to 779b86d Compare May 22, 2026 12:31
@Alizter Alizter requested review from Alizter and rgrinberg May 22, 2026 15:38
@rgrinberg
Copy link
Copy Markdown
Member

What happened to the benchmarks?

Do we have tests that show that we can still use abbreviated command names?

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented May 22, 2026

What happened to the benchmarks?

They are having a bad day today. They will resolve themselves soon.

Do we have tests that show that we can still use abbreviated command names?

Yes, this is the main change between 2.0 and 2.1. A mechanism to support the old prefixes was added. These are all exercised in the dune init tests and a few others.

@ElectreAAS
Copy link
Copy Markdown
Collaborator Author

Do we have tests that show that we can still use abbreviated command names?

We do have some, but only by (I assume) accident:

We may have others depending on typos. If you think they'd be needed with this PR I'll add a few that specifically test for this

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented May 22, 2026

@rgrinberg Here are the patches on the newer cmdliner that we will maintain from now on:

dbuenzli/cmdliner@master...ElectreAAS:dune-cmdliner:push-rtpovsrrqquv

in cmdliner_trie.ml at the bottom, we hardcode the legacy prefix support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update vendored cmdliner to 2.1.1

3 participants