Closed GoogleCodeExporter closed 9 years ago
Seems like you've uncovered a bug. It does handle "--" correctly, unless you
don't have any positional arguments. Can you please file this bug on the Python
tracker (bugs.python.org)? All future work on argparse will occur in the Python
trunk, not here.
Sample code:
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('-v', action='store_true')
>>> parser.add_argument('foo')
>>> parser.parse_args(['-v', '--', '--foo'])
Namespace(foo='--foo', v=True)
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('-v', action='store_true')
>>> parser.parse_args(['--', '-f'])
usage: [-h] [-v]
: error: unrecognized arguments: -- -f
Original comment by steven.b...@gmail.com
on 24 Jun 2010 at 7:38
Done http://bugs.python.org/issue9077
Original comment by iElect...@gmail.com
on 24 Jun 2010 at 11:35
Moved to bugs.python.org.
Original comment by steven.b...@gmail.com
on 23 Jul 2010 at 2:28
Original issue reported on code.google.com by
iElect...@gmail.com
on 24 Jun 2010 at 2:13