I\'ve read this http://docs.python.org/release/2.6.2/library/optparse.html
But I\'m not so clear how to make an option to be required in optparse?
I\'ve tried to
You can implement a required option easily.
parser = OptionParser(usage='usage: %prog [options] arguments')
parser.add_option('-f', '--file',
dest='filename',
help='foo help')
(options, args) = parser.parse_args()
if not options.filename: # if filename is not given
parser.error('Filename not given')