WP_CLI::set_logger( $logger );
}
+ private function wp_exists() {
+ return is_readable( ABSPATH . 'wp-includes/version.php' );
+ }
+
private function check_wp_version() {
- if ( !is_readable( ABSPATH . 'wp-includes/version.php' ) ) {
+ if ( !$this->wp_exists() ) {
WP_CLI::error(
"This does not seem to be a WordPress install.\n" .
"Pass --path=`path/to/wordpress` or run `wp core download`." );
}
}
+ // Handle --path parameter
+ self::set_wp_root( $this->config );
+
// First try at showing man page
- if ( $this->cmd_starts_with( array( 'help' ) ) ) {
+ if ( 'help' === $this->arguments[0] &&
+ ( isset( $this->arguments[1] ) || !$this->wp_exists() ) ) {
$this->_run_command();
}
- // Handle --path parameter
- self::set_wp_root( $this->config );
-
// Handle --url and --blog parameters
$url = self::guess_url( $this->config );
if ( $url ) {