Repository navigation
Add optparse-applicative command option parsing - #12438
Draft
philderbeast wants to merge 15 commits into
Draft
philderbeast wants to merge 15 commits into
philderbeast wants to merge 15 commits into
Conversation
philderbeast
marked this pull request as draft
October 10, 2026 13:27
philderbeast
force-pushed
the
add/optparse-applicative-minimal
branch
3 times, most recently
from
October 10, 2026 13:52
ce94093 to
f19c915
Compare
- Smallest set of sample values
philderbeast
force-pushed
the
add/optparse-applicative-minimal
branch
from
October 12, 2026 12:55
f19c915 to
cfa9bd8
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.
Fixes #5607 from the parsing side, the v2 commands (bare, new- and v2- spellings), now parse their command lines with
optparse-applicative. Does not include printing the help that I'll take from #12213 separately.QA Notes
cabal build --helpandcabal build --list-optionsshould print exactly what they printed before.cabal build --dryandcabal install --lib, where an exact name beats a longer one it is a prefix of.cabal build -jandcabal build --allow-neweron their own should take their defaults and not swallow the next word, socabal build -j allbuilds the targetallwith the default job count.cabal build --libshould be rejected as ambiguous, listing the candidate options.cabal ./script.hsandcabal run ./script.hs -- argsshould behave as before.cabal build --bogus, an example of a mistyped option now dumps optparse's full usage (I'm not sure I should fix this now, leave it as-is or bundle a fix for it when printing the help withoptparse-applicative):significance: significantin the changelog file.