OSDN Git Service

fix case where a file-only config key would make a runtime arg of the
authorscribu <mail@scribu.net>
Thu, 24 Oct 2013 00:08:07 +0000 (03:08 +0300)
committerscribu <mail@scribu.net>
Thu, 24 Oct 2013 00:08:19 +0000 (03:08 +0300)
same name disappear

php/WP_CLI/Configurator.php

index ed79ee5..ff2d204 100644 (file)
@@ -64,18 +64,17 @@ class Configurator {
                foreach ( $mixed_args as $tmp ) {
                        list( $key, $value ) = $tmp;
 
-                       if ( isset( $this->spec[ $key ] ) ) {
+                       if ( isset( $this->spec[ $key ] ) && $this->spec[ $key ]['runtime'] ) {
                                $details = $this->spec[ $key ];
-                               if ( $details['runtime'] ) {
-                                       if ( isset( $details['deprecated'] ) ) {
-                                               fwrite( STDERR, "WP-CLI: The --{$key} global parameter is deprecated. {$details['deprecated']}\n" );
-                                       }
 
-                                       if ( $details['multiple'] ) {
-                                               $runtime_config[ $key ][] = $value;
-                                       } else {
-                                               $runtime_config[ $key ] = $value;
-                                       }
+                               if ( isset( $details['deprecated'] ) ) {
+                                       fwrite( STDERR, "WP-CLI: The --{$key} global parameter is deprecated. {$details['deprecated']}\n" );
+                               }
+
+                               if ( $details['multiple'] ) {
+                                       $runtime_config[ $key ][] = $value;
+                               } else {
+                                       $runtime_config[ $key ] = $value;
                                }
                        } else {
                                $assoc_args[ $key ] = $value;