What is the most straightforward way to parse a variable number of command line arguments?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/253556/what-parameter-parser-libraries-are-there-for-c">What parameter parser libraries are there for C++?</a>  </p>
</blockquote>



<p>Suppose a program can be given a variable number of arguments</p>

<pre><code>--art &lt;A or B&gt; or -a &lt;A or B&gt;
--ball or -b
--help or -h
--one &lt;C or D&gt; or -o &lt;C or D&gt;
</code></pre>

<p>In which any can be used number can be used and --art and --one can, but don't have to, be specified with an A or B or C or D, respectively  (any of these can also be represented by one - and the letter). I've looked at getopt, but I'm having trouble understanding exactly how it works, so if this is the recommended method an explanation would greatly help.</p>

<p>Thank you.</p>
