Skip to content

Commit

Permalink
Merge pull request #186 from ernilambar/update/package-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Apr 26, 2024
2 parents fe5657f + 8b57210 commit afa90e9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 42 deletions.
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ WP-CLI packages are community-maintained projects built on WP-CLI. They can
contain WP-CLI commands, but they can also just extend WP-CLI in some way.

Learn how to create your own command from the
[Commands Cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/)
[Commands Cookbook](https://make.wordpress.org/cli/handbook/guides/commands-cookbook/)

**EXAMPLES**

# List installed packages
# List installed packages.
$ wp package list
+-----------------------+------------------------------------------+---------+----------+
| name | description | authors | version |
+-----------------------+------------------------------------------+---------+----------+
| wp-cli/server-command | Start a development server for WordPress | | dev-main |
+-----------------------+------------------------------------------+---------+----------+
+-----------------------+------------------+----------+-----------+----------------+
| name | authors | version | update | update_version |
+-----------------------+------------------+----------+-----------+----------------+
| wp-cli/server-command | Daniel Bachhuber | dev-main | available | 2.x-dev |
+-----------------------+------------------+----------+-----------+----------------+

# Install the latest development version of the package
# Install the latest development version of the package.
$ wp package install wp-cli/server-command
Installing package wp-cli/server-command (dev-main)
Updating /home/person/.wp-cli/packages/composer.json to require the package...
Expand All @@ -53,11 +53,11 @@ Learn how to create your own command from the
---
Success: Package installed.

# Uninstall package
# Uninstall package.
$ wp package uninstall wp-cli/server-command
Removing require statement from /home/person/.wp-cli/packages/composer.json
Deleting package directory /home/person/.wp-cli/packages/vendor/wp-cli/server-command
Regenerating Composer autoload.
Removing require statement for package 'wp-cli/server-command' from /home/person/.wp-cli/packages/composer.json
Removing repository details from /home/person/.wp-cli/packages/composer.json
Removing package directories and regenerating autoloader...
Success: Uninstalled package.


Expand Down Expand Up @@ -225,12 +225,13 @@ These fields are optionally available:

**EXAMPLES**

# List installed packages.
$ wp package list
+-----------------------+------------------------------------------+---------+----------+
| name | description | authors | version |
+-----------------------+------------------------------------------+---------+----------+
| wp-cli/server-command | Start a development server for WordPress | | dev-main |
+-----------------------+------------------------------------------+---------+----------+
+-----------------------+------------------+----------+-----------+----------------+
| name | authors | version | update | update_version |
+-----------------------+------------------+----------+-----------+----------------+
| wp-cli/server-command | Daniel Bachhuber | dev-main | available | 2.x-dev |
+-----------------------+------------------+----------+-----------+----------------+



Expand Down Expand Up @@ -278,10 +279,11 @@ wp package uninstall <name> [--insecure]

**EXAMPLES**

# Uninstall package.
$ wp package uninstall wp-cli/server-command
Removing require statement from /home/person/.wp-cli/packages/composer.json
Deleting package directory /home/person/.wp-cli/packages/vendor/wp-cli/server-command
Regenerating Composer autoload.
Removing require statement for package 'wp-cli/server-command' from /home/person/.wp-cli/packages/composer.json
Removing repository details from /home/person/.wp-cli/packages/composer.json
Removing package directories and regenerating autoloader...
Success: Uninstalled package.

## Installing
Expand Down
50 changes: 28 additions & 22 deletions src/Package_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
* contain WP-CLI commands, but they can also just extend WP-CLI in some way.
*
* Learn how to create your own command from the
* [Commands Cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/)
* [Commands Cookbook](https://make.wordpress.org/cli/handbook/guides/commands-cookbook/)
*
* ## EXAMPLES
*
* # List installed packages
* # List installed packages.
* $ wp package list
* +-----------------------+------------------------------------------+---------+----------+
* | name | description | authors | version |
* +-----------------------+------------------------------------------+---------+----------+
* | wp-cli/server-command | Start a development server for WordPress | | dev-main |
* +-----------------------+------------------------------------------+---------+----------+
* +-----------------------+------------------+----------+-----------+----------------+
* | name | authors | version | update | update_version |
* +-----------------------+------------------+----------+-----------+----------------+
* | wp-cli/server-command | Daniel Bachhuber | dev-main | available | 2.x-dev |
* +-----------------------+------------------+----------+-----------+----------------+
*
* # Install the latest development version of the package
* # Install the latest development version of the package.
* $ wp package install wp-cli/server-command
* Installing package wp-cli/server-command (dev-main)
* Updating /home/person/.wp-cli/packages/composer.json to require the package...
Expand All @@ -59,11 +59,11 @@
* ---
* Success: Package installed.
*
* # Uninstall package
* # Uninstall package.
* $ wp package uninstall wp-cli/server-command
* Removing require statement from /home/person/.wp-cli/packages/composer.json
* Deleting package directory /home/person/.wp-cli/packages/vendor/wp-cli/server-command
* Regenerating Composer autoload.
* Removing require statement for package 'wp-cli/server-command' from /home/person/.wp-cli/packages/composer.json
* Removing repository details from /home/person/.wp-cli/packages/composer.json
* Removing package directories and regenerating autoloader...
* Success: Uninstalled package.
*
* @package WP-CLI
Expand Down Expand Up @@ -450,12 +450,13 @@ public function install( $args, $assoc_args ) {
*
* ## EXAMPLES
*
* # List installed packages.
* $ wp package list
* +-----------------------+------------------------------------------+---------+----------+
* | name | description | authors | version |
* +-----------------------+------------------------------------------+---------+----------+
* | wp-cli/server-command | Start a development server for WordPress | | dev-main |
* +-----------------------+------------------------------------------+---------+----------+
* +-----------------------+------------------+----------+-----------+----------------+
* | name | authors | version | update | update_version |
* +-----------------------+------------------+----------+-----------+----------------+
* | wp-cli/server-command | Daniel Bachhuber | dev-main | available | 2.x-dev |
* +-----------------------+------------------+----------+-----------+----------------+
*
* @subcommand list
*/
Expand All @@ -476,11 +477,15 @@ public function list_( $args, $assoc_args ) {
*
* ## EXAMPLES
*
* # Get package path
* # Get package path.
* $ wp package path
* /home/person/.wp-cli/packages/
*
* # Change directory to package path
* # Get path to an installed package.
* $ wp package path wp-cli/server-command
* /home/person/.wp-cli/packages/vendor/wp-cli/server-command
*
* # Change directory to package path.
* $ cd $(wp package path) && pwd
* /home/vagrant/.wp-cli/packages
*/
Expand Down Expand Up @@ -559,10 +564,11 @@ public function update() {
*
* ## EXAMPLES
*
* # Uninstall package.
* $ wp package uninstall wp-cli/server-command
* Removing require statement from /home/person/.wp-cli/packages/composer.json
* Deleting package directory /home/person/.wp-cli/packages/vendor/wp-cli/server-command
* Regenerating Composer autoload.
* Removing require statement for package 'wp-cli/server-command' from /home/person/.wp-cli/packages/composer.json
* Removing repository details from /home/person/.wp-cli/packages/composer.json
* Removing package directories and regenerating autoloader...
* Success: Uninstalled package.
*/
public function uninstall( $args, $assoc_args ) {
Expand Down

0 comments on commit afa90e9

Please sign in to comment.