Skip to content

Commit c42d6ab

Browse files
committed
rename the option to be exclude_tables
1 parent 819d71d commit c42d6ab

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/DB_Command.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ public function query( $args, $assoc_args ) {
264264
*
265265
* [--tables=<tables>]
266266
* : The comma separated list of specific tables to export. Excluding this parameter will export all tables in the database.
267+
*
268+
* [--exclude_tables=<tables>]
269+
* : The comma separated list of specific tables that should be skipped from exporting. Excluding this parameter will export all tables in the database.
267270
*
268271
* [--porcelain]
269272
* : Output filename for the exported database.
@@ -287,15 +290,15 @@ public function query( $args, $assoc_args ) {
287290
* Success: Exported to 'wordpress_dbase.sql'.
288291
*
289292
* # Skip certain tables from the exported database
290-
* $ wp db export --skip-tables=wp_options,wp_users
293+
* $ wp db export --exclude_tables=wp_options,wp_users
291294
* Success: Exported to 'wordpress_dbase.sql'.
292295
*
293296
* # Skip all tables matching a wildcard from the exported database
294-
* $ wp db export --skip-tables=$(wp db tables 'wp_user*' --format=csv)
297+
* $ wp db export --exclude_tables=$(wp db tables 'wp_user*' --format=csv)
295298
* Success: Exported to 'wordpress_dbase.sql'.
296299
*
297300
* # Skip all tables matching prefix from the exported database
298-
* $ wp db export --skip-tables=$(wp db tables --all-tables-with-prefix --format=csv)
301+
* $ wp db export --exclude_tables=$(wp db tables --all-tables-with-prefix --format=csv)
299302
* Success: Exported to 'wordpress_dbase.sql'.
300303
*
301304
* @alias dump
@@ -332,9 +335,9 @@ public function export( $args, $assoc_args ) {
332335
}
333336
}
334337

335-
if ( isset( $assoc_args['skip-tables'] ) ) {
336-
$tables = explode( ',', trim( $assoc_args['skip-tables'], ',' ) );
337-
unset( $assoc_args['skip-tables'] );
338+
if ( isset( $assoc_args['exclude_tables'] ) ) {
339+
$tables = explode( ',', trim( $assoc_args['exclude_tables'], ',' ) );
340+
unset( $assoc_args['exclude_tables'] );
338341
foreach ( $tables as $table ) {
339342
$command .= ' --ignore-table';
340343
$command .= ' %s';

0 commit comments

Comments
 (0)