From 453eff2f35a6e90365312fe7ddf45431321cf853 Mon Sep 17 00:00:00 2001 From: scribu Date: Sun, 4 Aug 2013 21:53:35 +0300 Subject: [PATCH] always pass docs through WP_CLI::colorize() --- php/commands/help.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/php/commands/help.php b/php/commands/help.php index 72bd6c47..e2c28ae1 100644 --- a/php/commands/help.php +++ b/php/commands/help.php @@ -58,15 +58,16 @@ class Help_Command extends WP_CLI_Command { $out = str_replace( "\t", ' ', $out ); + self::pass_through_pager( WP_CLI::colorize( $out ) ); + } + + private static function pass_through_pager( $out ) { if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ) { // no paging for Windows cmd.exe; sorry echo $out; - } else { - self::pass_through_pager( WP_CLI::colorize( $out ) ); + return 0; } - } - private static function pass_through_pager( $out ) { // convert string to file handle $fd = fopen( "php://temp", "r+" ); fputs( $fd, $out ); -- 2.11.0