Message114711
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 |
|
Date |
User |
Action |
Args |
2010-08-22 22:06:39 | bethard | set | recipients:
+ bethard, Tom.Browder |
2010-08-22 22:06:39 | bethard | set | messageid: <1282514799.47.0.38737432026.issue9653@psf.upfronthosting.co.za> |
2010-08-22 22:06:38 | bethard | link | issue9653 messages |
2010-08-22 22:06:37 | bethard | create | |
|