Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add biOption for two-argument options #415

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

roberth
Copy link
Contributor

@roberth roberth commented Mar 5, 2021

This is a potential solution to #271 and #284, observing that both issues only seem to want to parse a fixed number of two arguments per option. That certainly applies to my use case as well.

I don't think this solution is pretty, but it is backwards compatible and it does the job.

@HuwCampbell
Copy link
Collaborator

Interesting, but yeah I agree it's a bit janky.

So I'm not sure (using GADTs is almost certainly a no though as I'm trying to keep optparse very lean).

I think if people like yourself are really needing this, the best course of action is to resurrect #284, but make the behaviour opt-in under a new Mod OptionFields a modifier which turns on the variable length consumption.

That way people can't easily foot-gun themselves, and no-one's code will break.

@roberth roberth marked this pull request as draft January 25, 2024 13:52
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.

2 participants