php/WP_CLI/Configurator.php
public static function extract_assoc( $arguments ) {
		$positional_args = array();
		$assoc_args      = array();
		$global_assoc    = array();
		$local_assoc     = array();

		foreach ( $arguments as $arg ) {
			$positional_arg = null;
			$assoc_arg      = null;

			if ( preg_match( '|^--no-([^=]+)$|', $arg, $matches ) ) {
				$assoc_arg = array( $matches[1], false );
			} elseif ( preg_match( '|^--([^=]+)$|', $arg, $matches ) ) {
				$assoc_arg = array( $matches[1], true );
			} elseif ( preg_match( '|^--([^=]+)=(.*)|s', $arg, $matches ) ) {
				$assoc_arg = array( $matches[1], $matches[2] );
			} else {
				$positional = $arg;
			}

			if ( ! is_null( $assoc_arg ) ) {
				$assoc_args[] = $assoc_arg;
				if ( count( $positional_args ) ) {
					$local_assoc[] = $assoc_arg;
				} else {
					$global_assoc[] = $assoc_arg;
				}
			} elseif ( ! is_null( $positional ) ) {
				$positional_args[] = $positional;
			}
		}

		return array( $positional_args, $assoc_args, $global_assoc, $local_assoc );
	}
public static function extract_assoc( $arguments ) {
		$positional_args = array();
		$assoc_args      = array();
		$global_assoc    = array();
		$local_assoc     = array();

		foreach ( $arguments as $arg ) {
			$positional_arg = null;
			$assoc_arg      = null;

			if ( preg_match( '|^--no-([^=]+)$|', $arg, $matches ) ) {
				$assoc_arg = array( $matches[1], false );
			} elseif ( preg_match( '|^--([^=]+)$|', $arg, $matches ) ) {
				$assoc_arg = array( $matches[1], true );
			} elseif ( preg_match( '|^--([^=]+)=(.*)|s', $arg, $matches ) ) {
				$assoc_arg = array( $matches[1], $matches[2] );
			} else {
				$positional = $arg;
			}

			if ( ! is_null( $assoc_arg ) ) {
				$assoc_args[] = $assoc_arg;
				if ( count( $positional_args ) ) {
					$local_assoc[] = $assoc_arg;
				} else {
					$global_assoc[] = $assoc_arg;
				}
			} elseif ( ! is_null( $positional ) ) {
				$positional_args[] = $positional;
			}
		}

		return array( $positional_args, $assoc_args, $global_assoc, $local_assoc );
	}
public static function extract_assoc ( $ arguments ) { $ positional_args = array ( ) ; $ assoc_args = array ( ) ; $ global_assoc = array ( ) ; $ local_assoc = array ( ) ; foreach ( $ arguments as $ arg ) { $ positional_arg = null ; $ assoc_arg = null ; if ( preg_match ( '|^--no-([^=]+)$|' , $ arg , $ matches ) ) { $ assoc_arg = array ( $ matches [ 1 ] , false ) ; } elseif ( preg_match ( '|^--([^=]+)$|' , $ arg , $ matches ) ) { $ assoc_arg = array ( $ matches [ 1 ] , true ) ; } elseif ( preg_match ( '|^--([^=]+)=(.*)|s' , $ arg , $ matches ) ) { $ assoc_arg = array ( $ matches [ 1 ] , $ matches [ 2 ] ) ; } else { $ positional = $ arg ; } if ( ! is_null ( $ assoc_arg ) ) { $ assoc_args [ ] = $ assoc_arg ; if ( count ( $ positional_args ) ) { $ local_assoc [ ] = $ assoc_arg ; } else { $ global_assoc [ ] = $ assoc_arg ; } } elseif ( ! is_null ( $ positional ) ) { $ positional_args [ ] = $ positional ; } } return array ( $ positional_args , $ assoc_args , $ global_assoc , $ local_assoc ) ; }
Splits positional args from associative args.

@param array
@return array(array)
Splits positional args from associative args .