WP_CLI\Dispatcher
CompositeCommand::show_usage
Show the usage for all subcommands contained by the composite command.
Method of the class: CompositeCommand{}
No Hooks.
Returns
null. Nothing (null).
Usage
$CompositeCommand = new CompositeCommand(); $CompositeCommand->show_usage();
CompositeCommand::show_usage() CompositeCommand::show usage code WP-CLI 2.13.0-alpha
public function show_usage() {
$methods = $this->get_subcommands();
$i = 0;
foreach ( $methods as $subcommand ) {
$prefix = ( 0 === $i ) ? 'usage: ' : ' or: ';
++$i;
if ( WP_CLI::get_runner()->is_command_disabled( $subcommand ) ) {
continue;
}
WP_CLI::line( $subcommand->get_usage( $prefix ) );
}
$cmd_name = implode( ' ', array_slice( get_path( $this ), 1 ) );
WP_CLI::line();
WP_CLI::line( "See 'wp help $cmd_name <command>' for more information on a specific command." );
}