Skip to content

Update to cmdliner 2 - #351

Merged
NathanReb merged 1 commit into
OCamlPro:masterfrom
NathanReb:fix-dash-for-stdio
Aug 5, 2026
Merged

Update to cmdliner 2#351
NathanReb merged 1 commit into
OCamlPro:masterfrom
NathanReb:fix-dash-for-stdio

Conversation

@NathanReb

@NathanReb NathanReb commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #336

This PR updates ocp-indent to cmdliner 2. This was motivated by a bug (that only appeared when ocp-indent was compiled with cmdliner.1.3 and caused - to be rejected as an input argument instead of being treated as stdin) but it does come with a few extras:

  • we now install completion scripts alongside ocp-indent
  • we use cmdliner install to install manpages instead of having our custom rule
  • we use the new filepath argument converter instread of the raw string for the --output option.

Edit: I reverted the manpage installation as it was causing errors on windows which I'd rather not spend too much time debugging.

This also fixes a bug that caused '-' to be rejected as an input
argument when ocp-indent was compiled with cmdliner.1.3.

Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
@NathanReb
NathanReb force-pushed the fix-dash-for-stdio branch 2 times, most recently from 29e00f0 to 3459c9a Compare August 5, 2026 14:46
@NathanReb
NathanReb merged commit e11b781 into OCamlPro:master Aug 5, 2026
7 checks passed
Comment thread ocp-indent.opam
"ocaml" {>= "4.11"}
"dune" {>= "3.20"}
"cmdliner" {>= "1.3.0"}
"cmdliner" {>= "2.0.0"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you're updating to cmdliner.2.0 for bug fixes you might as well set the lower bound to 2.1 for even more bug fixes!

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.

Use - to specify stdio in file path arguments

2 participants