WP_CLI
Runner::run_command_and_exit
Method of the class: Runner{}
No Hooks.
Returns
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() Runner::run command and exit code WP-CLI 2.13.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;
}