php/class-wp-cli.php
private static function defer_command_addition( $name, $parent, $callable, $args = array() ) {
		$args['is_deferred']               = true;
		self::$deferred_additions[ $name ] = array(
			'parent'   => $parent,
			'callable' => $callable,
			'args'     => $args,
		);
		self::add_hook(
			"after_add_command:$parent",
			function () use ( $name ) {
				$deferred_additions = WP_CLI::get_deferred_additions();

				if ( ! array_key_exists( $name, $deferred_additions ) ) {
					return;
				}

				$callable = $deferred_additions[ $name ]['callable'];
				$args     = $deferred_additions[ $name ]['args'];
				WP_CLI::remove_deferred_addition( $name );

				WP_CLI::add_command( $name, $callable, $args );
			}
		);
	}
private static function defer_command_addition( $name, $parent, $callable, $args = array() ) {
		$args['is_deferred']               = true;
		self::$deferred_additions[ $name ] = array(
			'parent'   => $parent,
			'callable' => $callable,
			'args'     => $args,
		);
		self::add_hook(
			"after_add_command:$parent",
			function () use ( $name ) {
				$deferred_additions = WP_CLI::get_deferred_additions();

				if ( ! array_key_exists( $name, $deferred_additions ) ) {
					return;
				}

				$callable = $deferred_additions[ $name ]['callable'];
				$args     = $deferred_additions[ $name ]['args'];
				WP_CLI::remove_deferred_addition( $name );

				WP_CLI::add_command( $name, $callable, $args );
			}
		);
	}
private static function defer_command_addition ( $ name , $ parent , $ callable , $ args = array ( ) ) { $ args [ 'is_deferred' ] = true ; self :: $ deferred_additions [ $ name ] = array ( 'parent' => $ parent , 'callable' => $ callable , 'args' => $ args , ) ; self :: add_hook ( "after_add_command:$parent" , function ( ) use ( $ name ) { $ deferred_additions = WP_CLI :: get_deferred_additions ( ) ; if ( ! array_key_exists ( $ name , $ deferred_additions ) ) { return ; } $ callable = $ deferred_additions [ $ name ] [ 'callable' ] ; $ args = $ deferred_additions [ $ name ] [ 'args' ] ; WP_CLI :: remove_deferred_addition ( $ name ) ; WP_CLI :: add_command ( $ name , $ callable , $ args ) ; } ) ; }
Defer command addition for a sub-command if the parent command is not yet
registered.

@param string $name     Name for the sub-command.
@param string $parent   Name for the parent command.
@param string $callable Command implementation as a class, function or closure.
@param array  $args     Optional. See `WP_CLI::add_command()` for details.
Defer command addition for a sub - command if the parent command is not yet registered .