Optparse and a lot of if not
<p>I'm developing a program that receives some arguments and would like to make some of them required, but I'm steping in some problems:</p>

<ol>
<li>I really need to make the code Python 2.4.x compliant, so I (at least think that) can only use optparse</li>
<li>Would like to avoid code obscurity</li>
</ol>

<p>Here's what I made:</p>

<pre><code>def usage():
    parser = OptionParser()
    parser.add_option('-i', '--item', dest='item')
    parser.add_option('-m', '--monitor', dest='monitor')
    parser.add_option('-s', '--service', dest='service')
    parser.add_option('-u', '--status', dest='status')
    parser.add_option('-a', '--match', dest='match')
    parser.add_option('-v', '--value', dest='value')
    parser.add_option('-o', '--hostname', dest='hostname', default='')
    parser.add_option('-t', '--test', action='store_true', dest='test')
    parser.add_option('-U', '--url', dest='URL', default='')
    parser.add_option('--verbose', action='store_true', dest='verbose')

    (options, args) = parser.parse_args()

    if not options.item or not options.monitor or not options.service or \
                           not options.status or not options.match or \
                           not options.value:
        parser.print_help()
        sys.exit(-1)

    return options
</code></pre>

<p>I guess this is OK but I really don't think this is Pythonic. Is there a better way for do this condition checking?</p>

<p>Cheers,</p>