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

Bug #16320 StoreArray/Default/Choices conflict
Submitted: 2009-06-12 18:48 UTC
From: rquadling Assigned: izi
Status: Closed Package: Console_CommandLine (version 1.0.6)
PHP Version: 5_3 CVS-2009-06-12 OS: Windows XP SP3
Roadmaps: (Not assigned)    
Subscription  


 [2009-06-12 18:48 UTC] rquadling (Richard Quadling)
Description: ------------ Hi. I'll try and explain the issue. I have a list of modules. The scripts default behaviour is to process all the modules (Default). I may only want to process some modules (StoreArray). I also want to limit the modules so I don't get junk modules (choices). The end result is all the modules from the default list with any optional modules added. The results below are after running the script in 2 ways. The first is ... test_args.php and test_args.php -m Point -m Hyper Test script: --------------- <?php require_once 'Console/CommandLine.php'; $o_Parser = new Console_CommandLine(); $o_Parser->addOption( 'modules', array( 'short_name' => '-m', 'long_name' => '--module', 'description' => 'available modules', 'action' => 'StoreArray', 'default' => array('Point', 'Line', 'Area', 'Volume', 'Hyper'), 'choices' => array('Point', 'Line', 'Area', 'Volume', 'Hyper'), 'list' => array('Point', 'Line', 'Area', 'Volume', 'Hyper'), 'add_list_option' => True, 'help_name' => 'module(s)', ) ); print_r($o_Parser->parse()); Expected result: ---------------- Console_CommandLine_Result Object ( [options] => Array ( [modules] => Array ( [0] => Point [1] => Line [2] => Area [3] => Volume [4] => Hyper ) [list_modules] => [help] => ) [args] => Array ( ) [command_name] => [command] => ) Console_CommandLine_Result Object ( [options] => Array ( [modules] => Array ( [0] => Point [1] => Hyper ) [list_modules] => [help] => ) [args] => Array ( ) [command_name] => [command] => ) Actual result: -------------- Console_CommandLine_Result Object ( [options] => Array ( [modules] => Array ( [0] => Point [1] => Line [2] => Area [3] => Volume [4] => Hyper ) [list_modules] => [help] => ) [args] => Array ( ) [command_name] => [command] => ) Console_CommandLine_Result Object ( [options] => Array ( [modules] => Array ( [0] => Point [1] => Line [2] => Area [3] => Volume [4] => Hyper [5] => Point [6] => Hyper ) [list_modules] => [help] => ) [args] => Array ( ) [command_name] => [command] => )

Comments

 [2009-06-12 22:51 UTC] izi (David Jean Louis)
-Status: Open +Status: Closed -Assigned To: +Assigned To: izi
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net 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. Thanks Richard.