title: python argparse file extension checking
body: <p>can <code>argparse</code> be used to validate filename extensions for a filename cmd line parameter?</p>
  
  <p>e.g. if i have a python script i run from the cmd line:</p>
  
  <pre><code>$ script.py file.csv
  $ script.py file.tab
  $ script.py file.txt
  </code></pre>
  
  <p>i would like argparse to accept the 1st two filename cmd line options but reject the 3rd</p>
  
  <p>i know you can do something like this:</p>
  
  <pre><code>parser = argparse.ArgumentParser()
  parser.add_argument("fn", choices=["csv","tab"])
  args = parser.parse_args()
  </code></pre>
  
  <p>to specify two valid choices for a cmd line option</p>
  
  <p>what i'd like is this:</p>
  
  <pre><code>parser.add_argument("fn", choices=["*.csv","*.tab"])
  </code></pre>
  
  <p>to specify two valid file extensions for the cmd line option. Unfortunately this doesn't work - is there a way to achieve this using <code>argparse</code>?</p>