Skip to content
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

Merged
merged 19 commits into from Nov 18, 2013

Conversation

fryguybob
Copy link
Member

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 defaultMains.

deriving (Show, Data, Typeable)

makeLenses ''DiagramAnimOpts

Copy link
Member

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.

Copy link
Member Author

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.

@fryguybob
Copy link
Member Author

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.

@byorgey
Copy link
Member

byorgey commented Nov 13, 2013

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.

@fryguybob
Copy link
Member Author

Sounds good. I'll make some Trello cards for some of the tasks.

byorgey added a commit that referenced this pull request Nov 18, 2013
Add helpers for common optparse-applicative backend command line.
@byorgey byorgey merged commit 99ceab0 into master Nov 18, 2013
@byorgey byorgey deleted the optparse branch February 11, 2014 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants