OSDN Git Service

always pass docs through WP_CLI::colorize()
authorscribu <mail@scribu.net>
Sun, 4 Aug 2013 18:53:35 +0000 (21:53 +0300)
committerscribu <mail@scribu.net>
Sun, 4 Aug 2013 18:53:35 +0000 (21:53 +0300)
php/commands/help.php

index 72bd6c4..e2c28ae 100644 (file)
@@ -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 );