Skip to content

Commit 558b46a

Browse files
committed
Skip dashes
1 parent 6d022b6 commit 558b46a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Server_Command.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Server_Command extends WP_CLI_Command {
7070
*
7171
* @when before_wp_load
7272
*/
73-
public function __invoke( $_, $assoc_args ) {
73+
public function __invoke( $args, $assoc_args ) {
7474
$defaults = array(
7575
'host' => 'localhost',
7676
'port' => 8080,
@@ -103,8 +103,11 @@ public function __invoke( $_, $assoc_args ) {
103103
$cmd_args = array( WP_CLI::get_php_binary() );
104104

105105
// Add passthrough arguments before the -S flag
106-
if ( ! empty( $_ ) ) {
107-
foreach ( $_ as $arg ) {
106+
if ( ! empty( $args ) ) {
107+
foreach ( $args as $arg ) {
108+
if ( '--' === $arg ) {
109+
continue;
110+
}
108111
$cmd_format .= ' %s';
109112
$cmd_args[] = $arg;
110113
}

0 commit comments

Comments
 (0)