Skip to content
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ php:

env:
- WP_VERSION=latest
- WP_VERSION=3.4.2 WITH_RONN=1
- WP_VERSION=3.4.2

matrix:
exclude:
- php: 5.4
env: WP_VERSION=3.4.2 WITH_RONN=1
env: WP_VERSION=3.4.2

before_script: ./bin/ci/install_dependencies.sh

Expand Down
11 changes: 0 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ Also, please create or update the appropriate `.txt` file in the `man-src` direc

Lastly, please follow the [WordPress Coding Standards](http://make.wordpress.org/core/handbook/coding-standards/).

Generating man pages
--------------------

To generate a man page, WP-CLI looks for `.txt` files in the `man-src` directory. It also gathers information from the inline comments and the `@synopsis` annotations.

The compiled man page is placed in the `man` directory.

To (re)generate one or more man pages, you first need to have the [ronn](https://rubygems.org/gems/ronn) ruby gem installed.

Then, you can use the `wp help --gen` command.

Running the tests
-----------------

Expand Down
4 changes: 0 additions & 4 deletions bin/ci/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ set -ex
composer install --dev --no-interaction --prefer-source
composer require d11wtq/boris=dev-master --no-interaction --prefer-source

if [ -n "$WITH_RONN" ]; then
gem install ronn
fi

# set up WP install
./bin/wp core download --version=$WP_VERSION --path=/tmp/wp-cli-test-core-download-cache/

Expand Down
6 changes: 1 addition & 5 deletions bin/ci/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ set -ex

vendor/bin/phpunit

if [ -z "$WITH_RONN" ]; then
BEHAT_OPTS="--tags ~@ronn"
fi

vendor/bin/behat --format progress $BEHAT_OPTS
vendor/bin/behat --format progress
55 changes: 6 additions & 49 deletions features/help.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,21 @@ Feature: Get help about WP-CLI commands
Given an empty directory

When I run `wp help`
Then STDOUT should contain:
"""
Available commands:
"""
Then STDOUT should not be empty

When I run `wp help core`
Then STDOUT should contain:
"""
usage: wp core
"""
Then STDOUT should not be empty

When I run `wp help core download`
Then STDOUT should contain:
"""
WP-CORE-DOWNLOAD(1)
"""
Then STDOUT should not be empty

When I run `wp help --help`
Then STDOUT should contain:
"""
WP-HELP(1)
"""
When I run `wp help help`
Then STDOUT should not be empty

When I try `wp help non-existent-command`
Then the return code should be 1
And STDERR should not be empty

@ronn
Scenario: Generating help for subcommands
Given an empty directory
When I run `wp help --gen option`
Then STDOUT should be:
"""
generated option.1
"""

@ronn
Scenario: Generating help for multisite-only subcommands
Given an empty directory
When I run `wp help --gen site create`
Then STDOUT should be:
"""
generated site-create.1
"""

@ronn
Scenario: Help for third-party commands
Given a WP install
And a wp-content/plugins/test-cli/test-help.txt file:
Expand All @@ -76,17 +45,5 @@ Feature: Get help about WP-CLI commands
When I run `wp help test-help`
Then STDOUT should contain:
"""
usage: wp test-help
"""

When I run `wp help --gen test-help`
Then STDOUT should contain:
"""
generated test-help.1
"""

When I run `wp help test-help`
Then STDOUT should contain:
"""
WP-TEST-HELP(1)
wp test-help
"""
11 changes: 4 additions & 7 deletions man-src/help.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
## EXAMPLES

# (re)generates all man pages
wp help --gen
# get help for `core` command
wp help core

# (re)generate man pages for the `core` command
wp help --gen core

# (re)generate man page only for the `core download` subcommand
wp help --gen core download
# get help for `core download` subcommand
wp help core download
101 changes: 0 additions & 101 deletions man/cache.1

This file was deleted.

52 changes: 0 additions & 52 deletions man/cap.1

This file was deleted.

27 changes: 0 additions & 27 deletions man/comment-approve.1

This file was deleted.

28 changes: 0 additions & 28 deletions man/comment-count.1

This file was deleted.

35 changes: 0 additions & 35 deletions man/comment-create.1

This file was deleted.

Loading