PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Console » Console_Getopt » Bug #1499

Console_Getopt does not support args with spaces

Details

Submitted2004-05-25 23:26 UTC
Fromcrain at fuse dot net
StatusBogus
PackageConsole_Getopt
PHP Version4.3.2
OSWinXP Pro
Roadmaps(Not assigned)

Comments

[2004-05-25 23:26 UTC] crain at fuse dot net

Description:
------------
System::mkDir() fails to create directory if the supplied path name has one or more spaces in it, since it calls _parseArgs() which splits the path name on spaces ($argv = preg_split('/\s+/', $argv)). See discussion at http://marc.theaimsgroup.com/?l=seagull-general&m=108552405731570&w=2
for more info.

Using
// $Id: System.php,v 1.10 2004/05/05 19:37:43 cvsroot Exp $

I work around this by passing the directory to mkDir() as an array rather than as a string, but this doesn't follow the api.
Thanks!
Andy

[2004-05-28 08:21 UTC] cox at idecnet dot com

From the System.php source:

* In case you need to to pass file names with spaces,
* pass the params as an array:
*
* System::rm(array('-r', $file1, $dir1));

The API is documented to work so (http://pear.php.net/manual/en/core.pear.system.intro.php). Anyway this is a problem in Console_Getopt not handling args with spaces, that's why we support both modes. Even supporting them, the cost of quoting each arg would be bigger that just passing an array.

Tomas V.V.Cox

Reclassified as Console_Getopt issue

[2004-05-28 15:13 UTC] crain at fuse dot net

Oops, clearly I hadn't gone over the comments closely enough. Sorry about that. Anyway, now a bug search at least will turn up this information. As long as passing in an array is anticipated and OK, I'm happy! Should I close this bug?