Migrate from optparse-applicative-fork to optparse-applicative 0.19#1390
Draft
Jimbo4350 wants to merge 1 commit into
Draft
Migrate from optparse-applicative-fork to optparse-applicative 0.19#1390Jimbo4350 wants to merge 1 commit into
Jimbo4350 wants to merge 1 commit into
Conversation
Upstream now includes the prettyprinter switch (PR #428) and briefHangPoint formatter (PR #425), making the fork unnecessary. Two capabilities from the fork are not available in upstream: - prefRenderHelp: no hook to inject a custom renderer into the --help path - helpEmbedBriefDesc: replaced with the coarser briefHangPoint 35 The CLI_HELP_TRACE tracing (Ann/AnnTrace) is removed; it was never wired up. Golden tests will need updating due to formatting changes.
c44b06e to
0d0820d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace
optparse-applicative-fork 0.18.1.0with upstreamoptparse-applicative 0.19.0.0.Upstream has incorporated the two features that motivated the fork:
briefHangPoint)Capability regressions
Two fork-specific hooks have no upstream equivalent:
prefRenderHelp(helpRenderHelpin prefs) — the fork allowed injecting a custom renderer into all--helpoutput. Upstream has no such hook.customRenderHelpnow only covers the explicitcardano-cli helpcommand path;--helpon subcommands goes straight through optparse's built-inrenderHelp.helpEmbedBriefDesc PP.align— the fork took aDoc -> Docfunction for full control over usage line overflow. Upstream only hasbriefHangPoint :: Int -> PrefsMod, replaced here withbriefHangPoint 35. The formatting output will differ.Other changes
Render.hs: remove fork-specificAnn/AnnTraceHTML tracing; simplify tocustomRenderHelp = renderHelp. TheCLI_HELP_TRACEfeature was never wired up (noannTracecall sites) so nothing functional is lost.Transaction/Option.hs:H.yellow/H.underlinereplaced with local helpers viaH.annotate— upstream re-exportsPrettyprinter.Render.Terminalso the capability is there, just not pre-wrapped.Golden tests
The 492 help text golden files will need updating due to formatting differences from
briefHangPoint 35vshelpEmbedBriefDesc PP.align.Changelog
Context
Upstream has caught up with the two IOG PRs that motivated the fork. The fork's additional hooks (
prefRenderHelp,helpEmbedBriefDesc) are lost but may be worth raising with upstream if the formatting differences are unacceptable.How to trust this PR
optparse-applicative 0.19.0.0Checklist