Python argparse: Too few arguments
<p>I'm trying to use the argparse library in Python.  I want to have the user do something like:</p>

<pre><code>python my_script.py csv_name.csv [--dryrun]
</code></pre>

<p>where <code>--dryrun</code> is an optional parameter.</p>

<p>I then have the user enter an API key and secret key.  When I run my code, I get past entering the API and secret keys and then I get:</p>

<pre><code>usage: my_script.py [-h] csv dryrun
salesforceImporter.py: error: too few arguments
</code></pre>

<p>Here's my code:</p>

<pre><code>def main():
    api_key = getpass.getpass(prompt='Enter API Key: ')
    secret_key = getpass.getpass(prompt='Enter Secret Key: ')

    parser = argparse.ArgumentParser()
    parser.add_argument("csv")
    parser.add_argument("dryrun")
    args = parser.parse_args()

    validate_csv_name(args.csv)

    is_dry_run = args.dryrun == '--dryrun'
</code></pre>

<p>Any idea where I'm going wrong?</p>

<p>Thanks!</p>