This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bethard
Recipients Tom.Browder, bethard
Date 2010-08-22.22:06:37
SpamBayes Score 0.009595564
Marked as misclassified No
Message-id <1282514799.47.0.38737432026.issue9653@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, typo. Should have been len(sys.argv) == 1. Full script:

import argparse
import sys

parser = argparse.ArgumentParser()
parser.add_argument('--foo')

if len(sys.argv) == 1:
    parser.print_help()  
else:
    print(parser.parse_args())

With that script, I see:

$ ./python.exe temp.py 
usage: temp.py [-h] [--foo FOO]

optional arguments:
  -h, --help  show this help message and exit
  --foo FOO
History
Date User Action Args
2010-08-22 22:06:39bethardsetrecipients: + bethard, Tom.Browder
2010-08-22 22:06:39bethardsetmessageid: <1282514799.47.0.38737432026.issue9653@psf.upfronthosting.co.za>
2010-08-22 22:06:38bethardlinkissue9653 messages
2010-08-22 22:06:37bethardcreate