diff --git a/features/theme-install.feature b/features/theme-install.feature index 46088309..a49e7c23 100644 --- a/features/theme-install.feature +++ b/features/theme-install.feature @@ -109,6 +109,19 @@ Feature: Install WordPress themes Scenario: Installation of multiple themes with activate When I try `wp theme install twentytwelve twentyeleven --activate` Then STDERR should contain: - """ - Warning: Only a single theme can be active. - """ + """ + Warning: Only this single theme will be activated: twentyeleven + """ + + When I run `wp theme list --field=name` + Then STDOUT should contain: + """ + twentyeleven + twentytwelve + """ + + When I run `wp theme list --field=name --status=active` + Then STDOUT should contain: + """ + twentyeleven + """ diff --git a/src/Theme_Command.php b/src/Theme_Command.php index bd95f3bb..cac02679 100644 --- a/src/Theme_Command.php +++ b/src/Theme_Command.php @@ -489,7 +489,8 @@ protected function filter_item_list( $items, $args ) { */ public function install( $args, $assoc_args ) { if ( count( $args ) > 1 && Utils\get_flag_value( $assoc_args, 'activate', false ) ) { - WP_CLI::warning( 'Only a single theme can be active.' ); + WP_CLI::warning( sprintf( "Only this single theme will be activated: %s", end( $args ) ) ); + reset( $args ); } $theme_root = get_theme_root();