Skip to content

Commit a63c91a

Browse files
authored
Update src/Config_Command.php
1 parent 08363dc commit a63c91a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Config_Command.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,15 @@ public function create( $_, $assoc_args ) {
223223
$is_sqlite = self::is_sqlite_integration_active();
224224

225225
if ( ! $is_sqlite ) {
226+
$errors = [];
226227
if ( empty( $assoc_args['dbname'] ) ) {
227-
WP_CLI::error( 'Parameter errors:' . PHP_EOL . 'missing --dbname parameter (Set the database name.)' );
228+
$errors[] = 'missing --dbname parameter (Set the database name.)';
228229
}
229230
if ( empty( $assoc_args['dbuser'] ) ) {
230-
WP_CLI::error( 'Parameter errors:' . PHP_EOL . 'missing --dbuser parameter (Set the database user.)' );
231+
$errors[] = 'missing --dbuser parameter (Set the database user.)';
232+
}
233+
if ( ! empty( $errors ) ) {
234+
WP_CLI::error( 'Parameter errors:' . PHP_EOL . implode( PHP_EOL, $errors ) );
231235
}
232236
}
233237

0 commit comments

Comments
 (0)