Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
apparently no way to implement --foo[=val] #243
It's a fairly common pattern for an option --foo to set some default value, and --foo=val to set some more specific value. (With the equals sign being required before the value; a space is ambiguous in this case.)
I cannot find a way to implement this with optparse-applicative, without renaming one of the options from --foo to --bar.
This code compiles, and usage shows "[--foo ARG] | [--foo]", but parsing "--foo" fails.
I don't really like that as a way of implementing it even if it worked, due to the redundancy.
Could there be a version of
(#242 touches on this, but is also about a regression)
I agree it's not ideal.
But I believe you are correct in that if you enforce that the option must be specified with an
Without writing anything, I believe this will require a new entry in the