Author andersk
Recipients andersk, bethard, davidben, drm, eric.araujo, eric.smith, gdb, nelhage, r.david.murray, skilletaudio
Date 2011-12-28.22:20:10
SpamBayes Score 6.50969e-05
Marked as misclassified No
Message-id <1325110811.07.0.5298104621.issue9334@psf.upfronthosting.co.za>
In-reply-to
Content
James: That’s not related to this issue.  This issue is about options taking arguments beginning with dash (such as a2x --asciidoc-opts --safe, where --safe is the argument to --asciidoc-opts), not positional arguments beginning with dash.

Your observation isn’t a bug.  In all getopt-like parsers, -- is the only way to pass positional arguments beginning with -.  (Whether you shell-quoted the argument is irrelevant; the - is interpreted by the program, not the shell, after the shell has already stripped off the shell quoting.)

If your program doesn’t take any options and you’d like to parse positional arguments without requiring --, don’t use a getopt-like parser; use sys.argv directly.

If you still think your example is a bug, please file a separate report.
History
Date User Action Args
2011-12-28 22:20:11andersksetrecipients: + andersk, bethard, eric.smith, eric.araujo, r.david.murray, gdb, nelhage, drm, davidben, skilletaudio
2011-12-28 22:20:11andersksetmessageid: <1325110811.07.0.5298104621.issue9334@psf.upfronthosting.co.za>
2011-12-28 22:20:10andersklinkissue9334 messages
2011-12-28 22:20:10anderskcreate