From b63b1638d20bf63b1aea117a902fefede50d8b1b Mon Sep 17 00:00:00 2001 From: scribu Date: Tue, 1 Jan 2013 21:44:57 +0200 Subject: [PATCH] it's actually easier if we pass the whole 'wp' command --- php/class-wp-cli.php | 2 +- utils/syn-list.php | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/php/class-wp-cli.php b/php/class-wp-cli.php index a3097a15..085cb8fd 100644 --- a/php/class-wp-cli.php +++ b/php/class-wp-cli.php @@ -397,7 +397,7 @@ class WP_CLI { private static function cmd_dump() { $dump = self::command_to_array( self::$root ); - echo json_encode( $dump['subcommands'] ); + echo json_encode( $dump ); } private static function command_to_array( $command ) { diff --git a/utils/syn-list.php b/utils/syn-list.php index 5f7cf5cd..02e69b0a 100644 --- a/utils/syn-list.php +++ b/utils/syn-list.php @@ -21,7 +21,7 @@ function read_json() { return $json; } -function generate_synopsis( $command, $path ) { +function generate_synopsis( $command, $path = '' ) { $full_path = $path . ' ' . $command['name']; if ( !isset( $command['subcommands'] ) ) { @@ -33,9 +33,5 @@ function generate_synopsis( $command, $path ) { } } -$commands = read_json(); - -foreach ( $commands as $command ) { - generate_synopsis( $command, 'wp' ); -} +generate_synopsis( read_json() ); -- 2.11.0