title: OR function with argparse with two variables on the command line in Python
body: <p>I have a program that accepts a file as input, does some work with the contents of the file and the pushes it out to a server.  I want to add an optional command line switch to specify a "dry run" of the program whereby it does all the file crunching, but skips doing the writes out to the server.  I am using argparse to bring in the command line arguments, but I don't see a way to do an "OR" function between the arguments.  Here is what I'm more or less looking for...</p>
  
  <p><strong>Allowable options:</strong></p>
  
  <p>1) prog.py inputfile servername</p>
  
  <p>2) prog.py inputfile -d  </p>
  
  <p>3) prog.py inputfile -d servername</p>
  
  <p><strong>Dissallowed:</strong></p>
  
  <p>1) prog.py inputfile</p>
  
  <p>I want to ensure that either the server name <strong>"OR"</strong> the dry run flag are on the command line.  And, if both are there... that's OK too. (hence being an OR and not an XOR).  If I use mutually exclusive with required=true, I can get the XOR; but, I can't seem to figure out how to do this as an "OR" where both can be present.  To complicate matters, the server name is a positional argument and the dry run flag is an optional argument that could be anywhere on the command line. Does anyone have an idea on how to pull this off?</p>