OSDN Git Service

remove unnecessary temporary variable
authorscribu <mail@scribu.net>
Thu, 1 Aug 2013 00:49:25 +0000 (03:49 +0300)
committerscribu <mail@scribu.net>
Thu, 1 Aug 2013 00:49:25 +0000 (03:49 +0300)
php/commands/post.php
php/commands/user.php

index f368f7b..1792830 100644 (file)
@@ -97,7 +97,6 @@ class Post_Command extends \WP_CLI\CommandWithDBObject {
                $assoc_args = wp_parse_args( $assoc_args, array(
                        'format' => 'table'
                ) );
-               $format = $assoc_args['format'];
 
                $post_id = $args[0];
                if ( !$post_id || !$post = get_post( $post_id ) )
@@ -122,7 +121,7 @@ class Post_Command extends \WP_CLI\CommandWithDBObject {
                        break;
 
                default:
-                       \WP_CLI::error( "Invalid value for format: " . $format );
+                       \WP_CLI::error( "Invalid format: " . $assoc_args['format'] );
                        break;
 
                }
index f80b56c..7a874a0 100644 (file)
@@ -87,7 +87,7 @@ class User_Command extends \WP_CLI\CommandWithDBObject {
                        break;
 
                default:
-                       \WP_CLI::error( "Invalid value for format: " . $format );
+                       \WP_CLI::error( "Invalid format: " . $assoc_args['format'] );
                        break;
 
                }