Re: New CLI switches (was [PHP-DEV] Using CLI as a shell)

From: Date: Tue, 04 Feb 2003 19:25:45 +0000
Subject: Re: New CLI switches (was [PHP-DEV] Using CLI as a shell)
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-94013@lists.php.net to get a copy of this message
At 10:28 04.02.2003, Edin Kadribasic wrote:
First simply use "php -h" but i am also thinking about adding a man page. That is a bit too much text for 'php -h'. It should be moved to the online manual. Adding a man page would be great too.
I wrote already i will do so...but haven't yet the time.
[snip] find . -name '*.c' -o -name '*.h' | php -B '$l=0;' -R '$f=count(file($argn)); echo "$argn($n)\n";$l+=$f;' -E 'echo "Files: $argi, Lines: $l\n";' This appears to be equivelant of: find . -name '*.c' -o -name '*.h' | php -r 'while (!feof(STDIN)) { $q=count(file($n=trim(fgets(STDIN)))); echo "$n($q)\n"; $l+=$q; $f++; } echo "Files $f, Lines: $l\n";' Am I correct in this assumption? If yes, could please try to point out what are the advantages of -B -R -E and -F over using just -r?
Yes it is the same result. I never said you cannot do it otherwise. The reason i implemented the switches is that it makes thinks easier. And sometimes making things easier for users is better than knowing as a developer that there is a solution. regards marcus

« previous php.dev (#94013) next »