From 1fe9acbd7b030839d52f7c8f05adac7d446bb688 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 9 Apr 2018 19:04:29 +0100 Subject: [PATCH 1/2] Improve the formatting of various format parameter documentation. --- src/User_Meta_Command.php | 16 ++++++++++++++-- src/WP_CLI/CommandWithMeta.php | 20 ++++++++++++++++++-- src/WP_CLI/CommandWithTerms.php | 12 +++++++++++- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/User_Meta_Command.php b/src/User_Meta_Command.php index 27c9b1f78..1e32232e6 100644 --- a/src/User_Meta_Command.php +++ b/src/User_Meta_Command.php @@ -171,7 +171,13 @@ public function delete( $args, $assoc_args ) { * : The new metadata value. * * [--format=] - * : The serialization format for the value. Default is plaintext. + * : The serialization format for the value. + * --- + * default: plaintext + * options: + * - plaintext + * - json + * --- * * ## EXAMPLES * @@ -199,7 +205,13 @@ public function add( $args, $assoc_args ) { * : The new metadata value. * * [--format=] - * : The serialization format for the value. Default is plaintext. + * : The serialization format for the value. + * --- + * default: plaintext + * options: + * - plaintext + * - json + * --- * * ## EXAMPLES * diff --git a/src/WP_CLI/CommandWithMeta.php b/src/WP_CLI/CommandWithMeta.php index 4f383ed54..3edbc1b07 100644 --- a/src/WP_CLI/CommandWithMeta.php +++ b/src/WP_CLI/CommandWithMeta.php @@ -29,7 +29,16 @@ abstract class CommandWithMeta extends \WP_CLI_Command { * : Limit the output to specific row fields. Defaults to id,meta_key,meta_value. * * [--format=] - * : Accepted values: table, csv, json, count. Default: table + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - json + * - yaml + * - count + * --- * * [--orderby=] * : Set orderby which field. @@ -124,7 +133,14 @@ public function list_( $args, $assoc_args ) { * : The name of the meta field to get. * * [--format=] - * : Accepted values: table, json. Default: table + * : Get value in a particular format. + * --- + * default: var_export + * options: + * - var_export + * - json + * - yaml + * --- */ public function get( $args, $assoc_args ) { list( $object_id, $meta_key ) = $args; diff --git a/src/WP_CLI/CommandWithTerms.php b/src/WP_CLI/CommandWithTerms.php index f030fcae7..a0007bf47 100644 --- a/src/WP_CLI/CommandWithTerms.php +++ b/src/WP_CLI/CommandWithTerms.php @@ -48,7 +48,17 @@ abstract class CommandWithTerms extends \WP_CLI_Command { * : Limit the output to specific row fields. * * [--format=] - * : Accepted values: table, csv, json, count, ids. Default: table + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - json + * - yaml + * - count + * - ids + * --- * * ## AVAILABLE FIELDS * From 9acca2661a66289d153d8018a295f1a69d9bd50f Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Tue, 10 Apr 2018 08:31:39 -0700 Subject: [PATCH 2/2] Regenerate README from command docs --- README.md | 122 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 109 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index da8b6db19..fcf5eb45c 100644 --- a/README.md +++ b/README.md @@ -441,7 +441,14 @@ wp comment meta get [--format=] The name of the meta field to get. [--format=] - Accepted values: table, json. Default: table + Get value in a particular format. + --- + default: var_export + options: + - var_export + - json + - yaml + --- @@ -465,7 +472,16 @@ wp comment meta list [--keys=] [--fields=] [--format= Limit the output to specific row fields. Defaults to id,meta_key,meta_value. [--format=] - Accepted values: table, csv, json, count. Default: table + Render output in a particular format. + --- + default: table + options: + - table + - csv + - json + - yaml + - count + --- [--orderby=] Set orderby which field. @@ -1407,7 +1423,14 @@ wp network meta get [--format=] The name of the meta field to get. [--format=] - Accepted values: table, json. Default: table + Get value in a particular format. + --- + default: var_export + options: + - var_export + - json + - yaml + --- @@ -1431,7 +1454,16 @@ wp network meta list [--keys=] [--fields=] [--format= Limit the output to specific row fields. Defaults to id,meta_key,meta_value. [--format=] - Accepted values: table, csv, json, count. Default: table + Render output in a particular format. + --- + default: table + options: + - table + - csv + - json + - yaml + - count + --- [--orderby=] Set orderby which field. @@ -1702,7 +1734,7 @@ wp option get [--format=] Lists options and their values. ~~~ -wp option list [--search=] [--exclude=] [--autoload=] [--transients] [--field=] [--fields=] [--format=] [--orderby=] [--order=] +wp option list [--search=] [--exclude=] [--autoload=] [--transients] [--unserialize] [--field=] [--fields=] [--format=] [--orderby=] [--order=] ~~~ **OPTIONS** @@ -2461,7 +2493,14 @@ wp post meta get [--format=] The name of the meta field to get. [--format=] - Accepted values: table, json. Default: table + Get value in a particular format. + --- + default: var_export + options: + - var_export + - json + - yaml + --- @@ -2485,7 +2524,16 @@ wp post meta list [--keys=] [--fields=] [--format=] [ Limit the output to specific row fields. Defaults to id,meta_key,meta_value. [--format=] - Accepted values: table, csv, json, count. Default: table + Render output in a particular format. + --- + default: table + options: + - table + - csv + - json + - yaml + - count + --- [--orderby=] Set orderby which field. @@ -2678,7 +2726,17 @@ wp post term list ... [--field=] [--fields=] [--fo Limit the output to specific row fields. [--format=] - Accepted values: table, csv, json, count, ids. Default: table + Render output in a particular format. + --- + default: table + options: + - table + - csv + - json + - yaml + - count + - ids + --- **AVAILABLE FIELDS** @@ -3984,7 +4042,14 @@ wp term meta get [--format=] The name of the meta field to get. [--format=] - Accepted values: table, json. Default: table + Get value in a particular format. + --- + default: var_export + options: + - var_export + - json + - yaml + --- @@ -4008,7 +4073,16 @@ wp term meta list [--keys=] [--fields=] [--format=] [ Limit the output to specific row fields. Defaults to id,meta_key,meta_value. [--format=] - Accepted values: table, csv, json, count. Default: table + Render output in a particular format. + --- + default: table + options: + - table + - csv + - json + - yaml + - count + --- [--orderby=] Set orderby which field. @@ -4712,7 +4786,13 @@ wp user meta add [--format=] The new metadata value. [--format=] - The serialization format for the value. Default is plaintext. + The serialization format for the value. + --- + default: plaintext + options: + - plaintext + - json + --- **EXAMPLES** @@ -4940,7 +5020,13 @@ wp user meta update [--format=] The new metadata value. [--format=] - The serialization format for the value. Default is plaintext. + The serialization format for the value. + --- + default: plaintext + options: + - plaintext + - json + --- **EXAMPLES** @@ -5261,7 +5347,17 @@ wp user term list ... [--field=] [--fields=] [--fo Limit the output to specific row fields. [--format=] - Accepted values: table, csv, json, count, ids. Default: table + Render output in a particular format. + --- + default: table + options: + - table + - csv + - json + - yaml + - count + - ids + --- **AVAILABLE FIELDS**