return '<command>';
}
- function invoke( $args, $assoc_args ) {
+ function invoke( $args, $assoc_args, $extra_args ) {
$this->show_usage();
}
}
}
- function invoke( $args, $assoc_args ) {
-
+ function invoke( $args, $assoc_args, $extra_args ) {
if ( \WP_CLI::get_config( 'prompt' ) )
list( $args, $assoc_args ) = $this->prompt_args( $args, $assoc_args );
\WP_CLI::do_action( 'before_invoke:' . $this->get_parent()->get_name() );
- call_user_func( $this->when_invoked, $args, $assoc_args );
+ call_user_func( $this->when_invoked, $args, array_merge( $extra_args, $assoc_args ) );
}
}
$name = implode( ' ', $cmd_path );
if ( isset( $this->extra_config[ $name ] ) ) {
- $assoc_args = array_merge( $this->extra_config[ $name ], $assoc_args );
+ $extra_args = $this->extra_config[ $name ];
+ } else {
+ $extra_args = array();
}
try {
- $command->invoke( $final_args, $assoc_args );
+ $command->invoke( $final_args, $assoc_args, $extra_args );
} catch ( WP_CLI\Iterators\Exception $e ) {
WP_CLI::error( $e->getMessage() );
}