Conversation
src/DB_Command.php
Outdated
|
|
||
| $format = WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ); | ||
|
|
||
| WP_CLI\Utils\wp_get_table_names( [ $args[0] ], [] ); |
There was a problem hiding this comment.
Needs to use array() syntax.
| @@ -0,0 +1,40 @@ | |||
| Feature: Display information about a given table. | |||
|
|
|||
| Scenario: Display information about the wp_posts table | |||
There was a problem hiding this comment.
Schema might not be the same for older WordPress versions. A minimum version should be added.
There was a problem hiding this comment.
I think the last change to the database schema was for WP 4.2, so adding the following should work: @require-wp-4.2
src/DB_Command.php
Outdated
| 'format' => $format, | ||
| ); | ||
|
|
||
| $formatter = new Formatter($formatter_args, array( 'Field', 'Type', 'Null', 'Key', 'Default', 'Extra' ) ); |
There was a problem hiding this comment.
CS - Space missing before $formatter_args.
src/DB_Command.php
Outdated
| * +-----------------------+---------------------+------+-----+---------------------+----------------+ | ||
| * | ||
| * @when after_wp_load | ||
| * @alias fields |
There was a problem hiding this comment.
We should skip the alias and only use multiple names for BC reasons.
| @@ -0,0 +1,40 @@ | |||
| Feature: Display information about a given table. | |||
|
|
|||
| Scenario: Display information about the wp_posts table | |||
There was a problem hiding this comment.
I think the last change to the database schema was for WP 4.2, so adding the following should work: @require-wp-4.2
README.md
Outdated
|
|
||
| ### wp db columns | ||
|
|
||
| Display information about a given table. |
README.md
Outdated
| **OPTIONS** | ||
|
|
||
| [<table>] | ||
| Table name |
There was a problem hiding this comment.
Table name => Name of the database table.
README.md
Outdated
| Table name | ||
|
|
||
| [--format] | ||
| table, csv, json |
There was a problem hiding this comment.
Add description:
Render output in a particular format.
| [<table>] | ||
| Table name | ||
|
|
||
| [--format] |
There was a problem hiding this comment.
Should be: [--format=<format>]
| options: | ||
| - table | ||
| - csv | ||
| - json |
src/DB_Command.php
Outdated
| 'format' => $format, | ||
| ); | ||
|
|
||
| $formatter = new Formatter($formatter_args, array( 'Field', 'Type', 'Null', 'Key', 'Default', 'Extra' ) ); |
There was a problem hiding this comment.
Given $formatter_args is built in a separate variable, the header fields should get the same treatment, especially as they produce a very long line here.
|
You should also adapt the file https://github.com/wp-cli/db-command/blob/master/.github/settings.yml to add the |
Implements wp-cli/ideas#97.
Not sure if it's worth adding to the package, but I figured it might be useful.