@@ -517,6 +517,8 @@ public function patch( $args, $assoc_args ) {
517
517
$ group = Utils \get_flag_value ( $ assoc_args , 'group ' );
518
518
$ expiration = Utils \get_flag_value ( $ assoc_args , 'expiration ' );
519
519
520
+ \WP_CLI ::log ( var_export ( [ $ action , $ key ], true ) );
521
+
520
522
$ key_path = array_map (
521
523
function ( $ key ) {
522
524
if ( is_numeric ( $ key ) && ( (string ) intval ( $ key ) === $ key ) ) {
@@ -528,14 +530,20 @@ function ( $key ) {
528
530
array_slice ( $ args , 2 )
529
531
);
530
532
533
+ \WP_CLI ::log ( var_export ( $ key_path , true ) );
534
+
531
535
if ( 'delete ' === $ action ) {
532
536
$ patch_value = null ;
533
537
} elseif ( \WP_CLI \Entity \Utils::has_stdin () ) {
534
538
$ stdin_value = WP_CLI ::get_value_from_arg_or_stdin ( $ args , - 1 );
535
539
$ patch_value = WP_CLI ::read_value ( trim ( $ stdin_value ), $ assoc_args );
540
+ \WP_CLI ::log ( 'STDIN : ' . var_export ( $ key_path , true ) );
541
+ \WP_CLI ::log ( 'STDIN : ' . var_export ( $ patch_value , true ) );
536
542
} else {
537
543
// Take the patch value as the last positional argument. Mutates $key_path to be 1 element shorter!
538
544
$ patch_value = WP_CLI ::read_value ( array_pop ( $ key_path ), $ assoc_args );
545
+ \WP_CLI ::log ( 'NO STDIN : ' . var_export ( $ key_path , true ) );
546
+ \WP_CLI ::log ( 'NO STDIN : ' . var_export ( $ patch_value , true ) );
539
547
}
540
548
541
549
/* Need to make a copy of $current_value here as it is modified by reference */
0 commit comments