From 0ea43dd53018054f2627c206efcb2ce8c0b82224 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 13 Nov 2010 10:33:30 +0000 Subject: [PATCH] justify help memcached console help --- maintenance/mcc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maintenance/mcc.php b/maintenance/mcc.php index f13c444b58..92f6863522 100644 --- a/maintenance/mcc.php +++ b/maintenance/mcc.php @@ -31,8 +31,12 @@ 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) ); + } foreach ( $commandList as $cmd => $desc ) { - print "$cmd: $desc\n"; + printf( "%-{$max_cmd_len}s: %s\n", $cmd, $desc ); } } elseif ( isset( $commandList[$command] ) ) { print "$command: $commandList[$command]\n"; -- 2.20.1