Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions php/WP_CLI/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ private static function guess_url( $assoc_args ) {
return false;
}

/**
* Checks if the arguments passed to the WP-CLI binary start with the specified prefix.
*
* @param array $prefix An array of strings specifying the expected start of the arguments passed to the WP-CLI binary.
* For example, `['user', 'list']` checks if the arguments passed to the WP-CLI binary start with `user list`.
*
* @return bool `true` if the arguments passed to the WP-CLI binary start with the specified prefix, `false` otherwise.
*/
private function cmd_starts_with( $prefix ) {
return array_slice( $this->arguments, 0, count( $prefix ) ) === $prefix;
}
Expand Down
Loading