From: scribu Date: Sun, 4 Aug 2013 13:17:25 +0000 (+0300) Subject: convert tabs to spaces only when displaying in the CLI X-Git-Tag: v0.11.0~7^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8b21c3f17cd2eab2e6856aa96bf2772c031c3875;p=wvm%2Fwvm.git convert tabs to spaces only when displaying in the CLI --- diff --git a/php/commands/help.php b/php/commands/help.php index fb42b8a4..e4686e15 100644 --- a/php/commands/help.php +++ b/php/commands/help.php @@ -45,6 +45,9 @@ class Help_Command extends WP_CLI_Command { // definition lists $out = preg_replace( '/\n([^\n]+)\n: (.+?)\n/s', "\n\t\\1\n\t\t\\2\n", $out ); + // convert tabs to spaces + $out = preg_replace( '/^\t/m', " ", $out ); + $out = str_replace( "\t", ' ', $out ); echo WP_CLI::colorize( $out ); diff --git a/utils/convert-docs.php b/utils/convert-docs.php index 59c57334..e898b0e6 100644 --- a/utils/convert-docs.php +++ b/utils/convert-docs.php @@ -12,9 +12,6 @@ function convert_file( $path ) { return "\n$arg\n: "; }, $out ); - // convert tabs to spaces - $out = preg_replace( '/^\t/m', " ", $out ); - // prepend docblock notation # $out = preg_replace( '/^(.*)/m', "\t* \\1", $out );