dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
617a5b1
)
Max command length using one line of code
author
Antoine Musso
<hashar@users.mediawiki.org>
Sat, 4 Dec 2010 08:58:32 +0000
(08:58 +0000)
committer
Antoine Musso
<hashar@users.mediawiki.org>
Sat, 4 Dec 2010 08:58:32 +0000
(08:58 +0000)
Follow-up r76621 code review
maintenance/mcc.php
patch
|
blob
|
history
diff --git
a/maintenance/mcc.php
b/maintenance/mcc.php
index
92f6863
..
a8c79a7
100644
(file)
--- a/
maintenance/mcc.php
+++ b/
maintenance/mcc.php
@@
-31,10
+31,7
@@
function mccShowHelp( $command ) {
$command = 'fullhelp';
}
if ( $command === 'fullhelp' ) {
- $max_cmd_len = 0;
- foreach( array_keys( $commandList ) as $cmd ) {
- $max_cmd_len = max( $max_cmd_len, strlen($cmd) );
- }
+ $max_cmd_len = max( array_map( 'strlen', array_keys( $commandList ) ) );
foreach ( $commandList as $cmd => $desc ) {
printf( "%-{$max_cmd_len}s: %s\n", $cmd, $desc );
}