WP_CLI

Runner::run_command_and_exit()privateWP-CLI 1.0

Method of the class: Runner{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->run_command_and_exit( $help_exit_warning );
$help_exit_warning **
-
Default: ''

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

private function run_command_and_exit( $help_exit_warning = '' ) {
	$this->show_synopsis_if_composite_command();
	$this->run_command( $this->arguments, $this->assoc_args );
	if ( $this->cmd_starts_with( [ 'help' ] ) ) {
		// Help couldn't find the command so exit with suggestion.
		$suggestion_or_disabled = $this->find_command_to_run( array_slice( $this->arguments, 1 ) );
		if ( is_string( $suggestion_or_disabled ) ) {
			if ( $help_exit_warning ) {
				WP_CLI::warning( $help_exit_warning );
			}
			WP_CLI::error( $suggestion_or_disabled );
		}
		// Should never get here.
	}
	exit;
}