Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.2

Bug #12711 Subcommand support not working.
Submitted: 2007-12-17 23:58 UTC
From: rlee0001 Assigned: izi
Status: Closed Package: Console_CommandLine (version 0.1.0)
PHP Version: 5.2.3 OS: Ubuntu 7.10
Roadmaps: (Not assigned)    

 [2007-12-17 23:58 UTC] rlee0001 (Robert Lee)
Description: ------------ Throws a fatal error: Catchable fatal error: Argument 1 passed to Console_CommandLine::__construct() must be an array, string given, called in /usr/share/php/Console/CommandLine.php on line 448 and defined in /usr/share/php/Console/CommandLine.php on line 236 Test script: --------------- <?php require_once 'Console/CommandLine.php'; $parser = new Console_CommandLine(); $parser->description = 'Test Script'; $parser->version = '1.0.0'; $subcommand = $parser->addCommand('test'); $subcommand->addArgument('something'); $result = $parser->parse(); ?> Expected result: ---------------- Command line will be parsed and returned. Actual result: -------------- Error thrown.


 [2007-12-18 08:47 UTC] izi (David Jean Louis)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Hi Robert ! thanks for your bug report and patch, it is apreciated. I modified the patch a little (especially the $command->name = $name was wrong because $name can also be an instance of CommandLine_Command...) and committed the fixes this morning.
 [2007-12-18 17:50 UTC] rlee0001 (Robert Lee)
izi, Thanks for the update. I figured the patch would be incorrect as it is the first patch I've ever published. I'm also not very familiar with the package's source. -Robert