Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update find command docs #73

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,6 @@ to significantly improve performance.
Indicates depth at which the WordPress installations was found, and its
alias, if it has one.

```
$ wp find ./
+--------------------------------------+---------------------+-------+--------+
| version_path | version | depth | alias |
+--------------------------------------+---------------------+-------+--------+
| /Users/wpcli/wp-includes/version.php | 4.8-alpha-39357-src | 2 | @wpcli |
+--------------------------------------+---------------------+-------+--------+
```

**AVAILABLE FIELDS**

These fields will be displayed by default for each installation:

* version_path - Path to the version.php file.
* version - WordPress version.
* depth - Directory depth at which the installation was found.
* alias - WP-CLI alias, if one is registered.

These fields are optionally available:

* wp_path - Path that can be passed to `--path=<path>` global parameter.
* db_host - Host name for the database.
* db_user - User name for the database.
* db_name - Database name for the database.

**OPTIONS**

<path>
Expand Down Expand Up @@ -83,6 +58,32 @@ These fields are optionally available:
[--verbose]
Log useful information to STDOUT.

**AVAILABLE FIELDS**

These fields will be displayed by default for each installation:

* version_path - Path to the version.php file.
* version - WordPress version.
* depth - Directory depth at which the installation was found.
* alias - WP-CLI alias, if one is registered.

These fields are optionally available:

* wp_path - Path that can be passed to `--path=<path>` global parameter.
* db_host - Host name for the database.
* db_user - User name for the database.
* db_name - Database name for the database.

**EXAMPLES**

# Find WordPress installations.
$ wp find ./
+--------------------------------------+---------------------+-------+--------+
| version_path | version | depth | alias |
+--------------------------------------+---------------------+-------+--------+
| /Users/wpcli/wp-includes/version.php | 4.8-alpha-39357-src | 2 | @wpcli |
+--------------------------------------+---------------------+-------+--------+

## Installing

Installing this package requires WP-CLI v2 or greater. Update to the latest stable release with `wp cli update`.
Expand Down
51 changes: 26 additions & 25 deletions src/Find_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,31 +125,6 @@ class Find_Command {
* Indicates depth at which the WordPress installations was found, and its
* alias, if it has one.
*
* ```
* $ wp find ./
* +--------------------------------------+---------------------+-------+--------+
* | version_path | version | depth | alias |
* +--------------------------------------+---------------------+-------+--------+
* | /Users/wpcli/wp-includes/version.php | 4.8-alpha-39357-src | 2 | @wpcli |
* +--------------------------------------+---------------------+-------+--------+
* ```
*
* ## AVAILABLE FIELDS
*
* These fields will be displayed by default for each installation:
*
* * version_path - Path to the version.php file.
* * version - WordPress version.
* * depth - Directory depth at which the installation was found.
* * alias - WP-CLI alias, if one is registered.
*
* These fields are optionally available:
*
* * wp_path - Path that can be passed to `--path=<path>` global parameter.
* * db_host - Host name for the database.
* * db_user - User name for the database.
* * db_name - Database name for the database.
*
* ## OPTIONS
*
* <path>
Expand Down Expand Up @@ -185,6 +160,32 @@ class Find_Command {
* [--verbose]
* : Log useful information to STDOUT.
*
* ## AVAILABLE FIELDS
*
* These fields will be displayed by default for each installation:
*
* * version_path - Path to the version.php file.
* * version - WordPress version.
* * depth - Directory depth at which the installation was found.
* * alias - WP-CLI alias, if one is registered.
*
* These fields are optionally available:
*
* * wp_path - Path that can be passed to `--path=<path>` global parameter.
* * db_host - Host name for the database.
* * db_user - User name for the database.
* * db_name - Database name for the database.
*
* ## EXAMPLES
*
* # Find WordPress installations.
* $ wp find ./
* +--------------------------------------+---------------------+-------+--------+
* | version_path | version | depth | alias |
* +--------------------------------------+---------------------+-------+--------+
* | /Users/wpcli/wp-includes/version.php | 4.8-alpha-39357-src | 2 | @wpcli |
* +--------------------------------------+---------------------+-------+--------+
*
* @when before_wp_load
*/
public function __invoke( $args, $assoc_args ) {
Expand Down