mtdhelpExample - CMSROMA/MTDDB GitHub Wiki

import sys
import getopt
from mtdConstructionDBTools import mtdcdb

shrtopts = 'hwx:y:'
longopts = ['help', 'what', 'xml=', 'yetanotheroption=']
helpopts = ['shows this help',
            'what?',
            'specity an xml file',
            'a dummy one'
            ]

try:
    opts, args = getopt.getopt(sys.argv[1:], shrtopts, longopts)
except Exception as excptn:
    print("Unexpected exception: " + str(excptn))
    mtdcdb.mtdhelp(shrtopts, longopts, helpopts)