#!/usr/bin/env python
"""
Render the most recent listings on the arXiv to a set of audio files.

Usage: arxiv2speech [-h | --help] [-u URL] [-o OUTPUT] [--clobber]

    -h --help  show this
    -u URL     custom arXiv RSS [default: http://export.arxiv.org/rss/astro-ph]
    -o OUTPUT  base directory for output [default: ./build]
    --clobber  overwrite an existing archive
    --quiet    don't print any status messages

"""

from __future__ import absolute_import, unicode_literals

from docopt import docopt

try:
    import arxiv2speech
    arxiv2speech = arxiv2speech
except ImportError:
    import os
    import sys
    sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(
                                                                __file__))))
    import arxiv2speech
    arxiv2speech = arxiv2speech

from arxiv2speech import run


if __name__ == "__main__":
    arguments = docopt(__doc__)
    run(arguments["-o"], url=arguments["-u"], clobber=arguments["--clobber"],
        quiet=arguments["--quiet"])
