#!/usr/bin/env python
#
# The Coopr workflow driver
#

import coopr.pyomo
import pyutilib.workflow
import sys

if sys.version_info[0:2] < (2,4):
   print ""
   print "ERROR: sp requires Python 2.4 or newer"
#
# Create driver
#
driver = pyutilib.workflow.TaskDriver(prog='coopr', 
description='This is script uses subcommands to execute Coopr\'s optimization workflows.')
#
# Add subcommand for every coopr.wf.* plugin task
#
prefix = 'coopr.wf.'
for name in pyutilib.workflow.TaskFactory().services():
    if name.startswith(prefix):
        driver.register_task(name, name[len(prefix):], help=pyutilib.workflow.TaskFactory.doc(name))
#
# Parse the command-line arguments to execute a subcommand
#
driver.parse_args()

