Skip to content

Commit 0ac6652

Browse files
Merge pull request #168 from johnbillion/format-format
Improve the formatting of various format parameter documentation
2 parents 43525b9 + 9acca26 commit 0ac6652

File tree

4 files changed

+152
-18
lines changed

4 files changed

+152
-18
lines changed

README.md

Lines changed: 109 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,14 @@ wp comment meta get <id> <key> [--format=<format>]
441441
The name of the meta field to get.
442442

443443
[--format=<format>]
444-
Accepted values: table, json. Default: table
444+
Get value in a particular format.
445+
---
446+
default: var_export
447+
options:
448+
- var_export
449+
- json
450+
- yaml
451+
---
445452

446453

447454

@@ -465,7 +472,16 @@ wp comment meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>
465472
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
466473

467474
[--format=<format>]
468-
Accepted values: table, csv, json, count. Default: table
475+
Render output in a particular format.
476+
---
477+
default: table
478+
options:
479+
- table
480+
- csv
481+
- json
482+
- yaml
483+
- count
484+
---
469485

470486
[--orderby=<fields>]
471487
Set orderby which field.
@@ -1407,7 +1423,14 @@ wp network meta get <id> <key> [--format=<format>]
14071423
The name of the meta field to get.
14081424

14091425
[--format=<format>]
1410-
Accepted values: table, json. Default: table
1426+
Get value in a particular format.
1427+
---
1428+
default: var_export
1429+
options:
1430+
- var_export
1431+
- json
1432+
- yaml
1433+
---
14111434

14121435

14131436

@@ -1431,7 +1454,16 @@ wp network meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>
14311454
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
14321455

14331456
[--format=<format>]
1434-
Accepted values: table, csv, json, count. Default: table
1457+
Render output in a particular format.
1458+
---
1459+
default: table
1460+
options:
1461+
- table
1462+
- csv
1463+
- json
1464+
- yaml
1465+
- count
1466+
---
14351467

14361468
[--orderby=<fields>]
14371469
Set orderby which field.
@@ -1702,7 +1734,7 @@ wp option get <key> [--format=<format>]
17021734
Lists options and their values.
17031735

17041736
~~~
1705-
wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [--transients] [--field=<field>] [--fields=<fields>] [--format=<format>] [--orderby=<fields>] [--order=<order>]
1737+
wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [--transients] [--unserialize] [--field=<field>] [--fields=<fields>] [--format=<format>] [--orderby=<fields>] [--order=<order>]
17061738
~~~
17071739

17081740
**OPTIONS**
@@ -2461,7 +2493,14 @@ wp post meta get <id> <key> [--format=<format>]
24612493
The name of the meta field to get.
24622494

24632495
[--format=<format>]
2464-
Accepted values: table, json. Default: table
2496+
Get value in a particular format.
2497+
---
2498+
default: var_export
2499+
options:
2500+
- var_export
2501+
- json
2502+
- yaml
2503+
---
24652504

24662505

24672506

@@ -2485,7 +2524,16 @@ wp post meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>] [
24852524
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
24862525

24872526
[--format=<format>]
2488-
Accepted values: table, csv, json, count. Default: table
2527+
Render output in a particular format.
2528+
---
2529+
default: table
2530+
options:
2531+
- table
2532+
- csv
2533+
- json
2534+
- yaml
2535+
- count
2536+
---
24892537

24902538
[--orderby=<fields>]
24912539
Set orderby which field.
@@ -2678,7 +2726,17 @@ wp post term list <id> <taxonomy>... [--field=<field>] [--fields=<fields>] [--fo
26782726
Limit the output to specific row fields.
26792727

26802728
[--format=<format>]
2681-
Accepted values: table, csv, json, count, ids. Default: table
2729+
Render output in a particular format.
2730+
---
2731+
default: table
2732+
options:
2733+
- table
2734+
- csv
2735+
- json
2736+
- yaml
2737+
- count
2738+
- ids
2739+
---
26822740

26832741
**AVAILABLE FIELDS**
26842742

@@ -3984,7 +4042,14 @@ wp term meta get <id> <key> [--format=<format>]
39844042
The name of the meta field to get.
39854043

39864044
[--format=<format>]
3987-
Accepted values: table, json. Default: table
4045+
Get value in a particular format.
4046+
---
4047+
default: var_export
4048+
options:
4049+
- var_export
4050+
- json
4051+
- yaml
4052+
---
39884053

39894054

39904055

@@ -4008,7 +4073,16 @@ wp term meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>] [
40084073
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
40094074

40104075
[--format=<format>]
4011-
Accepted values: table, csv, json, count. Default: table
4076+
Render output in a particular format.
4077+
---
4078+
default: table
4079+
options:
4080+
- table
4081+
- csv
4082+
- json
4083+
- yaml
4084+
- count
4085+
---
40124086

40134087
[--orderby=<fields>]
40144088
Set orderby which field.
@@ -4712,7 +4786,13 @@ wp user meta add <user> <key> <value> [--format=<format>]
47124786
The new metadata value.
47134787

47144788
[--format=<format>]
4715-
The serialization format for the value. Default is plaintext.
4789+
The serialization format for the value.
4790+
---
4791+
default: plaintext
4792+
options:
4793+
- plaintext
4794+
- json
4795+
---
47164796

47174797
**EXAMPLES**
47184798

@@ -4940,7 +5020,13 @@ wp user meta update <user> <key> <value> [--format=<format>]
49405020
The new metadata value.
49415021

49425022
[--format=<format>]
4943-
The serialization format for the value. Default is plaintext.
5023+
The serialization format for the value.
5024+
---
5025+
default: plaintext
5026+
options:
5027+
- plaintext
5028+
- json
5029+
---
49445030

49455031
**EXAMPLES**
49465032

@@ -5261,7 +5347,17 @@ wp user term list <id> <taxonomy>... [--field=<field>] [--fields=<fields>] [--fo
52615347
Limit the output to specific row fields.
52625348

52635349
[--format=<format>]
5264-
Accepted values: table, csv, json, count, ids. Default: table
5350+
Render output in a particular format.
5351+
---
5352+
default: table
5353+
options:
5354+
- table
5355+
- csv
5356+
- json
5357+
- yaml
5358+
- count
5359+
- ids
5360+
---
52655361

52665362
**AVAILABLE FIELDS**
52675363

src/User_Meta_Command.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ public function delete( $args, $assoc_args ) {
171171
* : The new metadata value.
172172
*
173173
* [--format=<format>]
174-
* : The serialization format for the value. Default is plaintext.
174+
* : The serialization format for the value.
175+
* ---
176+
* default: plaintext
177+
* options:
178+
* - plaintext
179+
* - json
180+
* ---
175181
*
176182
* ## EXAMPLES
177183
*
@@ -199,7 +205,13 @@ public function add( $args, $assoc_args ) {
199205
* : The new metadata value.
200206
*
201207
* [--format=<format>]
202-
* : The serialization format for the value. Default is plaintext.
208+
* : The serialization format for the value.
209+
* ---
210+
* default: plaintext
211+
* options:
212+
* - plaintext
213+
* - json
214+
* ---
203215
*
204216
* ## EXAMPLES
205217
*

src/WP_CLI/CommandWithMeta.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ abstract class CommandWithMeta extends \WP_CLI_Command {
2929
* : Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
3030
*
3131
* [--format=<format>]
32-
* : Accepted values: table, csv, json, count. Default: table
32+
* : Render output in a particular format.
33+
* ---
34+
* default: table
35+
* options:
36+
* - table
37+
* - csv
38+
* - json
39+
* - yaml
40+
* - count
41+
* ---
3342
*
3443
* [--orderby=<fields>]
3544
* : Set orderby which field.
@@ -124,7 +133,14 @@ public function list_( $args, $assoc_args ) {
124133
* : The name of the meta field to get.
125134
*
126135
* [--format=<format>]
127-
* : Accepted values: table, json. Default: table
136+
* : Get value in a particular format.
137+
* ---
138+
* default: var_export
139+
* options:
140+
* - var_export
141+
* - json
142+
* - yaml
143+
* ---
128144
*/
129145
public function get( $args, $assoc_args ) {
130146
list( $object_id, $meta_key ) = $args;

src/WP_CLI/CommandWithTerms.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,17 @@ abstract class CommandWithTerms extends \WP_CLI_Command {
4848
* : Limit the output to specific row fields.
4949
*
5050
* [--format=<format>]
51-
* : Accepted values: table, csv, json, count, ids. Default: table
51+
* : Render output in a particular format.
52+
* ---
53+
* default: table
54+
* options:
55+
* - table
56+
* - csv
57+
* - json
58+
* - yaml
59+
* - count
60+
* - ids
61+
* ---
5262
*
5363
* ## AVAILABLE FIELDS
5464
*

0 commit comments

Comments
 (0)