Thread overview
[Issue 2714] New: std.getopt erroneously splits arguments
Mar 06, 2009
d-bugmail
Mar 07, 2009
d-bugmail
Apr 29, 2009
d-bugmail
March 06, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2714

           Summary: std.getopt erroneously splits arguments
           Product: D
           Version: 2.025
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: andrei@metalanguage.com
        ReportedBy: dhasenan@gmail.com


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.


-- 

March 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2714


andrei@metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Comment #1 from andrei@metalanguage.com  2009-03-06 19:17 -------
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)


-- 

April 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2714


andrei@metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




--