Changeset 3076


Ignore:
Timestamp:
Oct 5, 2010 1:01:17 AM (11 years ago)
Author:
wehart
Message:

Adding logic to show subcommand documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.misc/trunk/scripts/coopr

    r2980 r3076  
    33# The Coopr workflow driver
    44#
    5 import sys
     5
    66import coopr.pyomo
    77import pyutilib.workflow
     8import sys
     9
     10if sys.version_info[0:2] < (2,4):
     11   print ""
     12   print "ERROR: sp requires Python 2.4 or newer"
    813#
    914# Create driver
    1015#
    1116driver = pyutilib.workflow.TaskDriver(prog='coopr',
    12 description='This is script uses subcommands to execute Coopr\'s optimization workflows.',
    13 epilog='More details here...')
     17description='This is script uses subcommands to execute Coopr\'s optimization workflows.')
    1418#
    1519# Add subcommand for every coopr.wf.* plugin task
     
    1822for name in pyutilib.workflow.TaskFactory().services():
    1923    if name.startswith(prefix):
    20         driver.register_task(name, name[len(prefix):])
     24        driver.register_task(name, name[len(prefix):], help=pyutilib.workflow.TaskFactory.doc(name))
    2125#
    2226# Parse the command-line arguments to execute a subcommand
Note: See TracChangeset for help on using the changeset viewer.