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')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…