$this->name = $name;
$this->shortdesc = $docparser->get_shortdesc();
+ $this->longdesc = $docparser->get_longdesc();
$when_to_invoke = $docparser->get_tag( 'when' );
if ( $when_to_invoke ) {
return $this->shortdesc;
}
+ function get_longdesc() {
+ return $this->longdesc;
+ }
+
function get_synopsis() {
return '<subcommand>';
}
\WP_CLI::line( "See 'wp help $this->name <subcommand>' for more information on a specific subcommand." );
}
- function get_extra_markdown() {
- $md_file = self::find_extra_markdown_file( $this );
- if ( !$md_file )
- return '';
-
- return file_get_contents( $md_file );
- }
-
- private static function find_extra_markdown_file( $command ) {
- $cmd_path = get_path( $command );
- array_shift( $cmd_path ); // discard 'wp'
- $cmd_path = implode( '-', $cmd_path );
-
- foreach ( \WP_CLI::get_man_dirs() as $src_dir ) {
- $src_path = "$src_dir/$cmd_path.txt";
- if ( is_readable( $src_path ) )
- return $src_path;
- }
-
- return false;
- }
-
function find_subcommand( &$args ) {
$name = array_shift( $args );
$this->shortdesc = 'Manage WordPress through the command-line.';
}
- function get_extra_markdown() {
+ function get_longdesc() {
$binding = array();
foreach ( \WP_CLI::get_configurator()->get_spec() as $key => $details ) {
$dump = array(
'name' => $command->get_name(),
'description' => $command->get_shortdesc(),
+ 'longdesc' => $command->get_longdesc(),
);
foreach ( $command->get_subcommands() as $subcommand ) {
private static function show_help( $command ) {
$out = self::get_initial_markdown( $command );
- $out .= $command->get_extra_markdown();
+ $out .= $command->get_longdesc();
// section headers
$out = preg_replace( '/^## ([A-Z ]+)/m', '%9\1%n', $out );