WP_CLI\Dispatcher

get_path()WP-CLI 1.0

Get the path to a command, e.g. "core download"

No Hooks.

Return

String[].

Usage

get_path( $command );
$command(Subcommand|CompositeCommand) (required)
-

get_path() code WP-CLI 2.7.0-alpha

function get_path( $command ) {
	$path = [];

	do {
		array_unshift( $path, $command->get_name() );
	} while ( $command = $command->get_parent() );

	return $path;
}