CLI_Command::completions()publicWP-CLI 1.0

Generates tab completion strings.

OPTIONS

--line=<line>
The current command line to be executed.
--point=<point>
The index to the current cursor position relative to the beginning of the command.

EXAMPLES

# Generate tab completion strings.
$ wp cli completions --line='wp eva' --point=100
eval
eval-file

Метод класса: CLI_Command{}

No Hooks.

Return

null. Nothing.

Usage

$CLI_Command = new CLI_Command();
$CLI_Command->completions( $_, $assoc_args );
$_ (required)
-
$assoc_args (required)
-

Код CLI_Command::completions() WP-CLI 2.7.0-alpha

public function completions( $_, $assoc_args ) {
	$line  = substr( $assoc_args['line'], 0, $assoc_args['point'] );
	$compl = new Completions( $line );
	$compl->render();
}