optparse-applicative icon indicating copy to clipboard operation
optparse-applicative copied to clipboard

Add biOption for two-argument options

Open roberth opened this issue 4 years ago • 4 comments

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.

roberth avatar Mar 05 '21 13:03 roberth

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.

HuwCampbell avatar Mar 11 '21 09:03 HuwCampbell