Skip to content

Commit

Permalink
Update find command docs (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar authored Apr 4, 2024
1 parent 564c2c2 commit 48a7635
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 50 deletions.
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

0 comments on commit 48a7635

Please sign in to comment.