Skip to content

Commit 660fff5

Browse files
committed
Update command docs
1 parent f852acf commit 660fff5

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3384,7 +3384,7 @@ wp signup activate <signup>
33843384
**OPTIONS**
33853385

33863386
<signup>
3387-
Signup ID, user login, user email or activation key.
3387+
Signup ID, user login, user email, or activation key.
33883388

33893389
**EXAMPLES**
33903390

@@ -3405,7 +3405,7 @@ wp signup delete <signup>
34053405
**OPTIONS**
34063406

34073407
<signup>
3408-
Signup ID, user login, user email or activation key.
3408+
Signup ID, user login, user email, or activation key.
34093409

34103410
**EXAMPLES**
34113411

@@ -3417,7 +3417,7 @@ wp signup delete <signup>
34173417

34183418
### wp signup get
34193419

3420-
Gets details about the signup.
3420+
Gets details about a signup.
34213421

34223422
~~~
34233423
wp signup get <signup> [--field=<field>] [--fields=<fields>] [--format=<format>]
@@ -3426,13 +3426,13 @@ wp signup get <signup> [--field=<field>] [--fields=<fields>] [--format=<format>]
34263426
**OPTIONS**
34273427

34283428
<signup>
3429-
Signup ID, user login, user email or activation key.
3429+
Signup ID, user login, user email, or activation key.
34303430

34313431
[--field=<field>]
34323432
Instead of returning the whole signup, returns the value of a single field.
34333433

34343434
[--fields=<fields>]
3435-
Get a specific subset of the signup's fields.
3435+
Limit the output to specific fields. Defaults to all fields.
34363436

34373437
[--format=<format>]
34383438
Render output in a particular format.
@@ -3462,15 +3462,15 @@ wp signup get <signup> [--field=<field>] [--fields=<fields>] [--format=<format>]
34623462
Lists signups.
34633463

34643464
~~~
3465-
wp signup list [--field=<field>] [--<field>=<value>] [--fields=<fields>] [--format=<format>]
3465+
wp signup list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
34663466
~~~
34673467

3468+
[--<field>=<value>]
3469+
Filter the list by a specific field.
3470+
34683471
[--field=<field>]
34693472
Prints the value of a single field for each signup.
34703473

3471-
[--<field>=<value>]
3472-
Filter results by key=value pairs.
3473-
34743474
[--fields=<fields>]
34753475
Limit the output to specific object fields.
34763476

@@ -3483,8 +3483,8 @@ wp signup list [--field=<field>] [--<field>=<value>] [--fields=<fields>] [--form
34833483
- csv
34843484
- ids
34853485
- json
3486-
- yaml
34873486
- count
3487+
- yaml
34883488
---
34893489

34903490
**AVAILABLE FIELDS**

features/signup.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Feature: Manage signups in a multisite installation
7171
When I try `wp signup get bobuser`
7272
Then STDERR should be:
7373
"""
74-
Error: Invalid signup ID, email, login or activation key: 'bobuser'
74+
Error: Invalid signup ID, email, login, or activation key: 'bobuser'
7575
"""
7676

7777
Scenario: Activate signup

src/Signup_Command.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public function __construct() {
5252
/**
5353
* Lists signups.
5454
*
55+
* [--<field>=<value>]
56+
* : Filter the list by a specific field.
57+
*
5558
* [--field=<field>]
5659
* : Prints the value of a single field for each signup.
5760
*
58-
* [--<field>=<value>]
59-
* : Filter results by key=value pairs.
60-
*
6161
* [--fields=<fields>]
6262
* : Limit the output to specific object fields.
6363
*
@@ -70,8 +70,8 @@ public function __construct() {
7070
* - csv
7171
* - ids
7272
* - json
73-
* - yaml
7473
* - count
74+
* - yaml
7575
* ---
7676
*
7777
* ## AVAILABLE FIELDS
@@ -150,18 +150,18 @@ public function list_( $args, $assoc_args ) {
150150
}
151151

152152
/**
153-
* Gets details about the signup.
153+
* Gets details about a signup.
154154
*
155155
* ## OPTIONS
156156
*
157157
* <signup>
158-
* : Signup ID, user login, user email or activation key.
158+
* : Signup ID, user login, user email, or activation key.
159159
*
160160
* [--field=<field>]
161161
* : Instead of returning the whole signup, returns the value of a single field.
162162
*
163163
* [--fields=<fields>]
164-
* : Get a specific subset of the signup's fields.
164+
* : Limit the output to specific fields. Defaults to all fields.
165165
*
166166
* [--format=<format>]
167167
* : Render output in a particular format.
@@ -189,6 +189,10 @@ public function list_( $args, $assoc_args ) {
189189
public function get( $args, $assoc_args ) {
190190
$signup = $this->fetcher->get_check( $args[0] );
191191

192+
if ( empty( $assoc_args['fields'] ) ) {
193+
$assoc_args['fields'] = array_keys( (array) $signup );
194+
}
195+
192196
$formatter = $this->get_formatter( $assoc_args );
193197

194198
$formatter->display_items( array( $signup ) );
@@ -200,7 +204,7 @@ public function get( $args, $assoc_args ) {
200204
* ## OPTIONS
201205
*
202206
* <signup>
203-
* : Signup ID, user login, user email or activation key.
207+
* : Signup ID, user login, user email, or activation key.
204208
*
205209
* ## EXAMPLES
206210
*
@@ -230,7 +234,7 @@ public function activate( $args, $assoc_args ) {
230234
* ## OPTIONS
231235
*
232236
* <signup>
233-
* : Signup ID, user login, user email or activation key.
237+
* : Signup ID, user login, user email, or activation key.
234238
*
235239
* ## EXAMPLES
236240
*

src/WP_CLI/Fetchers/Signup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Signup extends Base {
1212
*
1313
* @var string
1414
*/
15-
protected $msg = "Invalid signup ID, email, login or activation key: '%s'";
15+
protected $msg = "Invalid signup ID, email, login, or activation key: '%s'";
1616

1717
/**
1818
* Get a signup.

0 commit comments

Comments
 (0)