WP_CLI

Runner::show_synopsis_if_composite_command()publicWP-CLI 1.0

Show synopsis if the called command is a composite command

Method of the class: Runner{}

No Hooks.

Return

null. Nothing (null).

Usage

$Runner = new Runner();
$Runner->show_synopsis_if_composite_command();

Runner::show_synopsis_if_composite_command() code WP-CLI 2.8.0-alpha

public function show_synopsis_if_composite_command() {
	$r = $this->find_command_to_run( $this->arguments );
	if ( is_array( $r ) ) {
		list( $command ) = $r;

		if ( $command->can_have_subcommands() ) {
			$command->show_usage();
			exit;
		}
	}
}