"""
Main entry point for the command-line interface
"""
import commands
from optparse import OptionParser
def option_parser (command_name) :
"""
Build the OptionParser that we use
"""
# create parser using the given command
parser = OptionParser(prog=command_name)
# define options
parser.add_option('-d', "--dir", dest='dir', help="Use DIR as the image/HTML path [default: CWD]", metavar='DIR', default='.')
return parser
def main (argv) :
"""
Main entry point
"""
# build optparser
parser = option_parser(argv[0])
# parse the given argv
options, filter_targets = parser.parse_args(argv[1:])
# run the selected command
return commands.main(options.dir, filter_targets)