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 helpers for common optparse-applicative backend command line. #135
Conversation
deriving (Show, Data, Typeable) | ||
|
||
makeLenses ''DiagramAnimOpts | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably want some options for doing a looped compile mode too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the loop stuff out of Postscript a while ago when I think was working on pages support. At the time I was thinking that that functionality would move to builder. I'll certainly add it in here when I convert a backend that has it.
As far as I know this is ready for merging. Things that could still use some work are documentation and additional standard options from backends other than -postscript. We could wait for these or merge now. |
I think since we're getting close to the feature freeze I'd rather wait to merge this until it is completely done, including all documentation. Not because I think it might not make it into 1.0 --- it should, and it will --- but just as extra organization/motivation, to help us keep track of what needs to be done. As for documentation, the most important thing we need is a series of good examples. We'll need to beef up the Haddocks a bit, of course, but also add a section to the user manual, or perhaps just a short mention in the user manual and a separate tutorial with all the examples. I'm happy to help---let me know what would be most useful. |
Sounds good. I'll make some Trello cards for some of the tasks. |
We need to know how to modify the base case options to put a new file name in place. Another approach could have been classy lenses, but this is simpler for now.
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 namemainWith
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 ondiagrams-postscript
shows how the added support here can be used to build our existingdefaultMain
s.