Skip to content

Commit a76c08d

Browse files
committed
Add support for JSON format for table list
1 parent 072503e commit a76c08d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/Tables.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public function run( $assoc_args = [] ) {
4949

5050
if ( 'csv' === $format ) {
5151
WP_CLI::line( implode( ',', $tables ) );
52+
} else if ( 'json' === $format ) {
53+
WP_CLI::line( json_encode( array_values( $tables ) ) );
5254
} else {
5355
foreach ( $tables as $table ) {
5456
WP_CLI::line( $table );

0 commit comments

Comments
 (0)