Bug 2714 – std.getopt erroneously splits arguments

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-03-06T17:57:00Z
Last change time
2015-06-09T01:21:08Z
Assigned to
andrei
Creator
dhasenan

Comments

Comment #0 by dhasenan — 2009-03-06T17:57:42Z
When you try: rdmd --eval='printf("Hello world\n");' You get an error. rdmd tried compiling the string 'printf("Hello'. Looking into this further, std.getopt explicitly ignores shell escaping. There's no way to pass in an argument with spaces using std.getopt. The fix is to eliminate lines 312 to 327 inclusive in std/getopt.d, and rely on the shell to split the arguments properly.
Comment #1 by andrei — 2009-03-06T19:17:40Z
Thanks, that's been fixed in svn already. Unfortunately that can't be built from source yet, but in the interim a Linux binary is to be found at http://ssli.ee.washington.edu/~aalexand/d/rdmd (I also added a --main option)