Closed GoogleCodeExporter closed 9 years ago
parse_known_args raises an error with subparsers (without subparsers it seems okay). Example script: import argparse p = argparse.ArgumentParser() sub = p.add_subparsers(dest='command') foo = sub.add_parser('foo') foo.add_argument('--test') bar = sub.add_parser('bar') def parse(*args): args = list(args) try: result = p.parse_known_args(args) print args, '->', result except SystemExit, e: print args, '-exit->', e parse('foo') parse('foo', '--test', 'this') parse('bar') parse('foo', '--blah')
Original issue reported on code.google.com by ianbick...@gmail.com on 14 Jan 2010 at 11:29
ianbick...@gmail.com
Original comment by steven.b...@gmail.com on 15 Jan 2010 at 12:18
steven.b...@gmail.com
Original issue reported on code.google.com by
ianbick...@gmail.com
on 14 Jan 2010 at 11:29