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

Bug #2600 Parameter with '=argument"
Submitted: 2004-10-23 16:19 UTC
From: toggg Assigned:
Status: Bogus Package: Console_Getargs
PHP Version: Irrelevant OS: FC2
Roadmaps: (Not assigned)    
Subscription  


 [2004-10-23 16:19 UTC] toggg
Description: ------------ Hello again ! $>pear ... upgrade-all ok: Console_Getargs 1.2.0 I have downloaded example.php from CVS (1.7) ---------> If I run: [...]$ php -q example.php --verbose Verbose: 3 ... ---------> Everything OK, (3 is "default when set") ---------> Or if I run: [...]$ php -q example.php --verbose 4 Verbose: 4 ... ---------> Everything still OK, (got 4 as requested) ---------> But if I run: [...]$ php -q example.php --verbose=4 ... ERROR! ... ---------> ??????????? Regards. bertrand.

Comments

 [2004-10-23 16:27 UTC] toggg
I'm so sorry, I forgot to edit SUMMARY of this report! "Non solo errare machina est sed etiam humanum !" ave bertrand.
 [2004-10-23 22:55 UTC] bmansion at mamasam dot com
php example.php -v > correct php example.php -v 2 > correct php example.php --verbose > correct php example.php --verbose 2 > correct php example.php -v=2 > incorrect php example.php --verbose=2 > incorrect Need help ? php example.php -h Outputs: -v --verbose (optional)value Set the verbose level. (3) not: -v --verbose=(optional)value Set the verbose level. (3) This is IIRC because verbose can behave like a switch as it has a default value. Unlike: -w --width=<value> Set the new width. So this is the expected and documented behavior.
 [2004-10-24 09:41 UTC] toggg
>>php example.php --verbose 2 >>>> correct >> >>php example.php --verbose=2 >>>> incorrect But why? It has nothing to do with the "default if set" ! Again, should users adapt their habits on what Getargs do or miss ?
 [2006-12-27 03:43 UTC] cellog (Greg Beaver)
bogus