OSDN Git Service

let format_items() handle case where fields aren't set, for now
authorscribu <mail@scribu.net>
Tue, 1 Oct 2013 15:42:18 +0000 (18:42 +0300)
committerscribu <mail@scribu.net>
Tue, 1 Oct 2013 15:42:18 +0000 (18:42 +0300)
php/WP_CLI/Formatter.php

index 65cf878..d9c5c02 100644 (file)
@@ -32,10 +32,8 @@ class Formatter {
        public function display_items( $items ) {
                if ( $this->args['field'] ) {
                        self::show_single_field( $items, $this->args['field'], $this->args['format'], $this->prefix );
-               } elseif ( $this->args['fields'] ) {
-                       \WP_CLI\Utils\format_items( $this->args['format'], $items, $this->args['fields'] );
                } else {
-                       trigger_error( 'Both --field= and --fields= parameters are missing.', E_USER_ERROR );
+                       \WP_CLI\Utils\format_items( $this->args['format'], $items, $this->args['fields'] );
                }
        }