Skip to content

use ppx_subliner for cleaner cmdliner CLI#83

Merged
c-cube merged 6 commits intomasterfrom
simon/ppx_subliner
Feb 9, 2026
Merged

use ppx_subliner for cleaner cmdliner CLI#83
c-cube merged 6 commits intomasterfrom
simon/ppx_subliner

Conversation

@c-cube
Copy link
Member

@c-cube c-cube commented Feb 8, 2026

convert some of the CLI parsing to ppx_subliner, easier to maintain.

Converted the Run command to use ppx_subliner, demonstrating a
significant reduction in boilerplate code.

Changes:
- Added ppx_subliner dependency to benchpress.opam
- Added ppx preprocessing to src/bin/dune
- Converted Run module from traditional cmdliner (147 lines) to
  ppx_subliner (81 lines) - a 45% reduction
- Kept complex cpus_term parser separate as it has custom logic

Benefits:
- Single source of truth: arguments defined once with types, defaults, docs
- Better type safety: named record fields instead of 20+ positional params
- Easier maintenance: add/remove/reorder arguments without manual $ composition
- More readable: arguments grouped logically in a record type

The generated --help output is identical to the original.
Converted List_files, Plot, Check_config, Prover_show, Task_show, and Sql_convert.
Dir module kept with manual Cmdliner due to custom enum type complexity.

Total reduction: 139 lines (347 removed, 208 added)
@c-cube c-cube force-pushed the simon/ppx_subliner branch from 27c8298 to 280296d Compare February 9, 2026 22:30
@c-cube c-cube marked this pull request as ready for review February 9, 2026 22:32
@c-cube c-cube changed the title Experiment: Use ppx_subliner for cleaner cmdliner CLI use ppx_subliner for cleaner cmdliner CLI Feb 9, 2026
@c-cube c-cube merged commit 93b50e9 into master Feb 9, 2026
3 checks passed
@c-cube c-cube deleted the simon/ppx_subliner branch February 9, 2026 22:34
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.

1 participant