[Haskell-beginners] Questions about optparse-applicative

Mike Meyer mwm at mired.org
Fri May 15 07:19:06 UTC 2015


In trying to convert eddie (http://hackage.haskell.org/package/eddie) from
CmdArgs optparse-applicative, I've run into a couple of problems.

First question: I have options whose legality depends on other options: two
that can't be specified together, and a couple that require one of the two,
among other things. Is there some way to specify such constraints when
building the parser? Maybe a way to print just the usage message if I check
these myself? Maybe a better approach?

It looks like if I replace main in test/Example/Hello.hs with:
main =  handleParseResult . Failure $ parserFailure (prefs idm) (info
sample briefDesc) ShowHelpText mempty

I should just get the Usage message output, but instead I get the full help
text.

Second, and possibly related, it's not at all clear what fullDesc does in
that example program. In particular, removing it doesn't seem to change the
program behavior. Is there some behavior I've missed, or is this an error?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150515/956f47ee/attachment.html>


More information about the Beginners mailing list