argparse arguments nesting
<p>I have a following code in python:</p>

<pre><code>parser = argparse.ArgumentParser(description='Deployment tool')
group = parser.add_mutually_exclusive_group()
group.add_argument('-a', '--add', dest='name_to_add', help='Add a new group or a role to existing group')
group.add_argument('-u', '--upgrade', dest='name_to_upgrade', help='Upgrade a group with the new version')
parser.add_argument('--web_port', help='Port of the WEB instance that is being added to the group')
</code></pre>

<p>My problem is with "--web_port" option. I want to be able to add this option only with "-a" option but not with "-u".</p>

<p>I <strong>want</strong> to be able to run: "python my_script.py -a name --web_port=XXXX".</p>

<p>I <strong>don't want</strong> to be able to run: "python my_script.py -u name --web_port=XXXX"</p>

<p>How should I change my code in order to be able to run it this way?</p>

<p>Thanks, Arshavski Alexander.</p>
