diff -r 189f331c7960 -r 20355dd2e61a degal/main.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/degal/main.py Wed Jun 03 20:33:15 2009 +0300 @@ -0,0 +1,35 @@ +""" + 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) +