Skip to content

Commit 2497846

Browse files
authored
Merge pull request #562 from wp-cli/update/handbook
2 parents cb605e8 + 47d145b commit 2497846

15 files changed

+330
-24
lines changed

bin/command.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ public function gen_hb_manifest() {
408408
'parent' => null,
409409
];
410410
}
411+
411412
// Internal API pages.
412413
foreach ( glob( WP_CLI_HANDBOOK_PATH . '/internal-api/*.md' ) as $file ) {
413414
$slug = basename( $file, '.md' );
@@ -426,6 +427,26 @@ public function gen_hb_manifest() {
426427
'parent' => 'internal-api',
427428
];
428429
}
430+
431+
// Behat steps pages.
432+
foreach ( glob( WP_CLI_HANDBOOK_PATH . '/behat-steps/*.md' ) as $file ) {
433+
$slug = basename( $file, '.md' );
434+
$title = '';
435+
$contents = file_get_contents( $file );
436+
if ( preg_match( '/^#\s(.+)/', $contents, $matches ) ) {
437+
$title = $matches[1];
438+
}
439+
$manifest[ $slug ] = [
440+
'title' => $title,
441+
'slug' => $slug,
442+
'markdown_source' => sprintf(
443+
'https://github.com/wp-cli/handbook/blob/main/behat-steps/%s.md',
444+
$slug
445+
),
446+
'parent' => 'ibehat-stepsapi',
447+
];
448+
}
449+
429450
file_put_contents( WP_CLI_HANDBOOK_PATH . '/bin/handbook-manifest.json', json_encode( $manifest, JSON_PRETTY_PRINT ) );
430451
WP_CLI::success( 'Generated bin/handbook-manifest.json' );
431452
}

bin/handbook-manifest.json

Lines changed: 288 additions & 6 deletions
Large diffs are not rendered by default.

internal-api/wp-cli-add-hook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Schedule a callback to be executed at a certain point.
1111
<div>
1212
<strong>$when</strong> (string) Identifier for the hook.<br />
1313
<strong>$callback</strong> (mixed) Callback to execute when hook is called.<br />
14-
<strong>@return</strong> (null) <br />
14+
<strong>@return</strong> (void) <br />
1515
</div>
1616

1717

internal-api/wp-cli-debug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Display debug message prefixed with &quot;Debug: &quot; when `--debug` is used.
1111
<div>
1212
<strong>$message</strong> (string|WP_Error|Exception|Throwable) Message to write to STDERR.<br />
1313
<strong>$group</strong> (string|bool) Organize debug message to a specific group.<br />
14-
<strong>@return</strong> (null) <br />
14+
<strong>@return</strong> (void) <br />
1515
</div>
1616

1717

internal-api/wp-cli-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Display informational message without prefix, and ignore `--quiet`.
1010

1111
<div>
1212
<strong>$message</strong> (string) Message to display to the end user.<br />
13-
<strong>@return</strong> (null) <br />
13+
<strong>@return</strong> (void) <br />
1414
</div>
1515

1616

internal-api/wp-cli-runcommand.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Run a WP-CLI command.
1010

1111
<div>
1212
<strong>$command</strong> (string) WP-CLI command to run, including arguments.<br />
13-
<strong>$options</strong> (array) Configuration options for command execution.<br />
13+
<strong>$options</strong> (array) {<br /> Configuration options for command execution.<br /> @type bool $launch Launches a new process (true) or reuses the existing process (false). Default: true.<br /> @type bool $exit_error Halts the script on error. Default: true.<br /> @type bool|string $return Returns output as an object when set to 'all' (string), return just the 'stdout', 'stderr', or 'return_code' (string) of command, or print directly to stdout/stderr (false). Default: false.<br /> @type bool|string $parse Parse returned output as 'json' (string); otherwise, output is unchanged (false). Default: false.<br />@param array $command_args Contains additional command line arguments for the command. Each element represents a single argument. Default: empty array.<br />}<br />
1414
<strong>@return</strong> (mixed) <br />
1515
</div>
1616

internal-api/wp-cli-success.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Display success message prefixed with &quot;Success: &quot;.
1010

1111
<div>
1212
<strong>$message</strong> (string) Message to write to STDOUT.<br />
13-
<strong>@return</strong> (null) <br />
13+
<strong>@return</strong> (void) <br />
1414
</div>
1515

1616

1717
***
1818

1919
## Notes
2020

21-
Success message is written to STDOUT.
21+
Success message is written to STDOUT, or discarded when `--quiet` flag is supplied.
2222

2323
Typically recommended to inform user of successful script conclusion.
2424

internal-api/wp-cli-utils-format-items.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Render a collection of items as an ASCII table, JSON, CSV, YAML, list of ids, or
1010

1111
<div>
1212
<strong>$format</strong> (string) Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count'.<br />
13-
<strong>$items</strong> (array) An array of items to output.<br />
14-
<strong>$fields</strong> (array|string) Named fields for each item of data. Can be array or comma-separated list.<br />
13+
<strong>$items</strong> (array&lt;mixed&gt;) An array of items to output.<br />
14+
<strong>$fields</strong> (array&lt;string&gt;|string) Named fields for each item of data. Can be array or comma-separated list.<br />
1515
</div>
1616

1717

internal-api/wp-cli-utils-get-flag-value.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Return the flag value or, if it's not set, the $default value.
99
WP_CLI\Utils\get_flag_value( $assoc_args, $flag, $default = null )
1010

1111
<div>
12-
<strong>$assoc_args</strong> (array) Arguments array.<br />
12+
<strong>$assoc_args</strong> (array&lt;string,string|bool&gt;) Arguments array.<br />
1313
<strong>$flag</strong> (string) Flag to get the value.<br />
1414
<strong>$default</strong> (mixed) Default value for the flag. Default: NULL.<br />
1515
<strong>@return</strong> (mixed) <br />

internal-api/wp-cli-utils-parse-ssh-url.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Parse a SSH url for its host, port, and path.
99
WP_CLI\Utils\parse_ssh_url( $url, $component = -1 )
1010

1111
<div>
12+
<strong>$url</strong> (string) <br />
13+
<strong>$component</strong> (int) <br />
1214
<strong>@return</strong> (mixed) <br />
1315
</div>
1416

0 commit comments

Comments
 (0)