CLI_Command::completions
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
Method of the class: CLI_Command{}
No Hooks.
Returns
null. Nothing (null).
Usage
$CLI_Command = new CLI_Command(); $CLI_Command->completions( $_, $assoc_args );
- $_(required)
- .
- $assoc_args(required)
- .
CLI_Command::completions() CLI Command::completions code WP-CLI 2.13.0-alpha
public function completions( $_, $assoc_args ) {
$line = substr( $assoc_args['line'], 0, $assoc_args['point'] );
$compl = new Completions( $line );
$compl->render();
}