WP_CLI\Dispatcher

CompositeCommand::show_usage()publicWP-CLI 1.0

Show the usage for all subcommands contained by the composite command.

Метод класса: CompositeCommand{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$CompositeCommand = new CompositeCommand();
$CompositeCommand->show_usage();

Код CompositeCommand::show_usage() WP-CLI 2.8.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." );
}