OSDN Git Service

fix formatting and update examples
authorscribu <mail@scribu.net>
Fri, 22 Nov 2013 20:07:41 +0000 (22:07 +0200)
committerscribu <mail@scribu.net>
Fri, 22 Nov 2013 20:07:41 +0000 (22:07 +0200)
php/WP_CLI/CommandWithUpgrade.php
php/commands/plugin.php
php/commands/theme.php

index 1e931bf..e4047e0 100644 (file)
@@ -251,7 +251,7 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command {
                if ( !is_array( $all_items ) )
                        \WP_CLI::error( "No {$this->item_type}s found." );
 
-               foreach( $all_items as $key => &$item ) {
+               foreach ( $all_items as $key => &$item ) {
 
                        if ( empty( $item['version'] ) )
                                $item['version'] = '';
@@ -264,14 +264,11 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command {
                                }
                        }
 
-                       foreach( $this->obj_fields as $field ) {
-
+                       foreach ( $this->obj_fields as $field ) {
                                if ( isset( $assoc_args[$field] )
                                        && $assoc_args[$field] != $item[$field] )
                                        unset( $all_items[$key] );
-
                        }
-
                }
 
                $formatter = $this->get_formatter( $assoc_args );
index 59436c6..f91aa01 100644 (file)
@@ -479,7 +479,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
         * Get a list of plugins.
         *
         * ## OPTIONS
-        * 
+        *
         * [--<field>=<value>]
         * : Filter results based on the value of a field.
         *
@@ -494,7 +494,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
         *
         * ## EXAMPLES
         *
-        *     wp plugin list --format=json
+        *     wp plugin list --status=active --format=json
         *
         * @subcommand list
         */
index 1fdf3cb..e9fa1e7 100644 (file)
@@ -376,7 +376,7 @@ class Theme_Command extends \WP_CLI\CommandWithUpgrade {
         * Get a list of themes.
         *
         * ## OPTIONS
-        * 
+        *
         * [--<field>=<value>]
         * : Filter results based on the value of a field.
         *
@@ -391,7 +391,7 @@ class Theme_Command extends \WP_CLI\CommandWithUpgrade {
         *
         * ## EXAMPLES
         *
-        *     wp theme list --format=csv
+        *     wp theme list --status=inactive --format=csv
         *
         * @subcommand list
         */