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

Run help early for wp core commands used when core isn't yet installed #2497

Merged
merged 1 commit into from Feb 21, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions features/help.feature
Expand Up @@ -37,6 +37,13 @@ Feature: Get help about WP-CLI commands
wp core config
"""

When I run `wp core config {CORE_CONFIG_SETTINGS}`
And I run `wp help core install`
Then STDOUT should contain:
"""
wp core install
"""

Scenario: Help for nonexistent commands
Given a WP install

Expand Down
2 changes: 1 addition & 1 deletion php/WP_CLI/Runner.php
Expand Up @@ -664,7 +664,7 @@ public function start() {
self::set_wp_root( $this->find_wp_root() );

// First try at showing man page
if ( 'help' === $this->arguments[0] && ( ! $this->wp_exists() || ! Utils\locate_wp_config() ) ) {
if ( 'help' === $this->arguments[0] && ( ! $this->wp_exists() || ! Utils\locate_wp_config() || 'core' === $this->arguments[1] && in_array( $this->arguments[2], array( 'config', 'install', 'multisite-install', 'verify-checksums', 'version' ) ) ) ) {
$this->_run_command();
}

Expand Down