Commit a8498629 authored by totten's avatar totten Committed by GitHub

Merge pull request #114 from jonesinator/master

Fix parameter parsing in wp-cli civicrm api.
parents 6d6e545c 03d442bc
......@@ -179,16 +179,17 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
array_shift( $this->args );
list( $entity, $action ) = explode( '.', $this->args[0] );
array_shift( $this->args );
# parse $params
switch ( $this->getOption( 'in', 'args' ) ) {
$format = $this->getOption( 'in', 'args' );
switch ( $format ) {
# input params supplied via args ..
case 'args':
$params = $defaults;
foreach ( $this->args as $arg ) {
preg_match( '/^( [^=]+ )=( .* )$/', $arg, $matches );
preg_match( '/^([^=]+)=(.*)$/', $arg, $matches );
$params[ $matches[1] ] = $matches[2];
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment