Then the return code should be 1
And STDERR should not be empty
- Scenario: Help for third-party commands
- Given a WP install
- And a wp-content/plugins/test-cli/test-help.txt file:
- """
- ## EXAMPLES
-
- wp test-help
- """
- And a wp-content/plugins/test-cli/command.php file:
- """
- <?php
- // Plugin Name: Test CLI Help
-
- class Test_Help extends WP_CLI_Command {
- function __invoke() {}
- }
-
- WP_CLI::add_command( 'test-help', 'Test_Help' );
-
- WP_CLI::add_man_dir( __DIR__, __DIR__ );
- """
- And I run `wp plugin activate test-cli`
-
- When I run `wp help test-help`
- Then STDOUT should contain:
- """
- wp test-help
- """
-
Scenario: Help for incomplete commands
Given an empty directory
private static $hooks = array(), $hooks_passed = array();
- private static $man_dirs = array();
-
/**
* Initialize WP_CLI static variables.
*/
static function init() {
- self::add_man_dir( null, WP_CLI_ROOT . "/man-src" );
-
self::$configurator = new WP_CLI\Configurator( WP_CLI_ROOT . '/php/config-spec.php' );
}
self::get_root_command()->add_subcommand( $name, $command );
}
- static function add_man_dir( $deprecated = null, $src_dir ) {
- self::$man_dirs[] = $src_dir;
- }
-
- static function get_man_dirs() {
- return self::$man_dirs;
- }
-
/**
* Display a message in the CLI and end with a newline
*
self::get_runner()->run_command( $args, $assoc_args );
}
+
+
+ // DEPRECATED STUFF
+
+ static function add_man_dir() {
+ trigger_error( 'WP_CLI::add_man_dir() is deprecated. Add docs inline.', E_USER_WARNING );
+ }
+
// back-compat
static function out( $str ) {
echo $str;