diagrams/diagrams-lib — pull request #135 by fryguybob (2013-11-10 19:27:04+00:00)
Title: Add helpers for common optparse-applicative backend command line.

This is probably not ready for merging, but it is ready for comments. The general goal here is to unify the various forms of `defaultMain` that we have in all of our backends. Additionally we want more flexibility so that we can write programs that have their own set of command line options that compose with any particular backend's options. Optparse-applicative gives us this flexibility and a few classes allow us to unify it all so that with one name `mainWith` we can handle a single diagram, multiple diagrams, multiple named diagrams, and functions that result in any of these.

All of the names we use here are up for debate, but I think we should keep `defaultMain` and friends as they are for backward compatibility. The optparse branch on `diagrams-postscript` shows how the added support here can be used to build our existing `defaultMain`s.