New CLI switches (was [PHP-DEV] Using CLI as a shell)
| From: | Edin Kadribasic | Date: | Tue, 04 Feb 2003 09:28:57 +0000 |
| Subject: | 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-93985@lists.php.net to get a copy of this message | ||
>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.
[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?
Edin