#! /usr/bin/env python
# pymakemenu

__doc__ = \
"""Generate an (S)VCD/DVD menu MPEG (to replace the 'makemenu' shell
script).
"""

import sys
import logging
from libtovid.menu import Menu

log = logging.getLogger('libtovid')
log.setLevel(logging.DEBUG)
log.addHandler(logging.StreamHandler(sys.stdout))

if __name__ == '__main__':
    """Create a Menu with provided options and generate it."""
    # If no arguments were provided, print usage notes
    # TODO: Proper argument verification
    if len(sys.argv) < 3:
        print 'Usage: pymakemenu [options] -out NAME'
        print 'Where [options] may be any of the following:'
        print Menu().options.usage()
        print 'Please provide an output name (-out).'
        sys.exit()

    args = sys.argv[1:]
    menu = Menu(args)
    menu.generate()
