@@ -772,6 +772,8 @@ public function size( $args, $assoc_args ) {
772
772
$ human_readable = WP_CLI \Utils \get_flag_value ( $ assoc_args , 'human-readable ' , false );
773
773
$ tables = WP_CLI \Utils \get_flag_value ( $ assoc_args , 'tables ' );
774
774
$ tables = ! empty ( $ tables );
775
+ $ all_tables = WP_CLI \Utils \get_flag_value ( $ assoc_args , 'all-tables ' );
776
+ $ all_tables_with_prefix = WP_CLI \Utils \get_flag_value ( $ assoc_args , 'all-tables-with-prefix ' );
775
777
776
778
if ( ! is_null ( $ size_format ) && $ human_readable ) {
777
779
WP_CLI ::error ( "Cannot use --size_format and --human-readable arguments at the same time. " );
@@ -792,7 +794,7 @@ public function size( $args, $assoc_args ) {
792
794
793
795
$ default_unit = ( empty ( $ size_format ) && ! $ human_readable ) ? ' B ' : '' ;
794
796
795
- if ( $ tables ) {
797
+ if ( $ tables || $ all_tables || $ all_tables_with_prefix ) {
796
798
797
799
// Add all of the table sizes
798
800
foreach ( WP_CLI \Utils \wp_get_table_names ( $ args , $ assoc_args ) as $ table_name ) {
@@ -900,7 +902,7 @@ public function size( $args, $assoc_args ) {
900
902
}
901
903
}
902
904
903
- if ( ! empty ( $ size_format ) && ! $ tables && ! $ format && ! $ human_readable ) {
905
+ if ( ! empty ( $ size_format ) && ! $ tables && ! $ format && ! $ human_readable && true !== $ all_tables && true !== $ all_tables_with_prefix ) {
904
906
WP_CLI ::Line ( filter_var ( $ rows [0 ]['Size ' ], FILTER_SANITIZE_NUMBER_INT ) );
905
907
} else {
906
908
// Display the rows.
0 commit comments