If have optional args ([<plugin>...]) and an all option, then check have something to do.

@param array $args Passed-in arguments.
@param bool $all All flag.
@return array Same as $args if not all, otherwise all slugs.
334021
private function check_optional_args_and_all( $args, $all, $verb = 'install' ) {
		if ( $all ) {
			$args = array_map(
				function( $file ) {
						return Utils\get_plugin_name( $file );
				},
				array_keys( $this->get_all_plugins() )
			);
		}

		if ( empty( $args ) ) {
			if ( ! $all ) {
				WP_CLI::error( 'Please specify one or more plugins, or use --all.' );
			}

			$past_tense_verb = Utils\past_tense_verb( $verb );
			WP_CLI::success( "No plugins {$past_tense_verb}." ); // Don't error if --all given for BC.
		}

		return $args;
	}
1016718
public function setArgs(array $args)
    {
        foreach ($args as $k => $v) {
            if (is_numeric($k)) {
                $this->args[$k] = $v;
            } else {
                $this->kwargs[$k] = $v;
            }
            ksort($this->args);
        }
        return $this;
    }
650901
private function parseArgs(array $args)
    {
        if (! count($args)) {
            return $this->createHelpArgument();
        }

        $arg1 = array_shift($args);

        if (in_array($arg1, ['-h', '--help', 'help'], true)) {
            return $this->createHelpArgument();
        }

        if (! count($args)) {
            return $this->createErrorArgument('Missing class name');
        }

        $configFile = $arg1;
        switch (file_exists($configFile)) {
            case true:
                $config = require $configFile;

                if (! is_array($config)) {
                    return $this->createErrorArgument(sprintf(
                        'Configuration at path "%s" does not return an array.',
                        $configFile
                    ));
                }

                break;
            case false:
                // fall-through
            default:
                if (! is_writable(dirname($configFile))) {
                    return $this->createErrorArgument(sprintf(
                        'Cannot create configuration at path "%s"; not writable.',
                        $configFile
                    ));
                }

                $config = [];
                break;
        }

        $class = array_shift($args);

        if (! class_exists($class)) {
            return $this->createErrorArgument(sprintf(
                'Class "%s" does not exist or could not be autoloaded.',
                $class
            ));
        }

        return $this->createArguments(self::COMMAND_DUMP, $configFile, $config, $class);
    }
400814
public function execute(array $args, array $options = [])
    {
        $rootDir = null;
        if (isset($options['root-dir']) && !empty($options['root-dir'])) {
            $rootDir = $options['root-dir'];
        }
        StaticResource::createSymbolicLink($rootDir);
    }
763849
private function _resolveArgs(array $args)
        {
            $resolved = array();
            foreach ($args as $argDefinition) {
                switch ($argDefinition['type']) {
                    case 'lookup':
                        $resolved[] = $this->_lookupRecursive($argDefinition['item']);
                        break;
                    case 'value':
                        $resolved[] = $argDefinition['item'];
                        break;
                }
            }

            return $resolved;
        }
916504
public function check(...$args)
    {
        if (count($args) !== count($this->constraints)) {
            throw new InvalidArgumentException(
                'Argument number mismatch.'
            );
        }

        foreach ($args as $key => $arg) {
            if (!$this->constraints[$key]->check($arg, $args)) {
                throw new InvalidArgumentException(vsprintf(
                    'Argument %s does not meet its constraints.'
                    . "\nFailed constraint: %s\nValue provided:%s",
                    [
                        $key,
                        $this->constraints[$key]->toString(),
                        print_r($arg, true)
                    ]
                ));
            }
        }
    }
428225
protected function parseValue( array $args )
	{
		$default = $args['default'];
		$name    = $args['name'];
		$prefix  = $args['prefix'];
		$value   = $args['value'];

		if( $default == ':placeholder' ) {
			$default = '';
		}

		return ( !empty( $value ) || !$name || $prefix === false )
			? $value
			: $default;
	}
194675
protected function _validateArgs(array $args): bool {
        foreach (self::REQUIRED_FLAGS as $flag) {
            if (!array_key_exists($flag, $args)) {
                Garp_Cli::errorOut("No {$flag} flag provided.");
                return false;
            }
        }
        return true;
    }
1244648
protected function libCall($args, $kwargs)
    {
        $name = $this->compileStringContent($this->coerceString($this->reduce(array_shift($args), true)));

        $args = array_map(
            function ($a) {
                return [null, $a, false];
            },
            $args
        );

        if (count($kwargs)) {
            foreach ($kwargs as $key => $value) {
                $args[] = [[Type::T_VARIABLE, $key], $value, false];
            }
        }

        return $this->reduce([Type::T_FUNCTION_CALL, $name, $args]);
    }
58847
protected function normalizeArgs(array $args)
    {
        $error = $this->app->make('helper/validation/error');
        $normalized = [
            'askNewTeamCID' => null,
            'askNewTeamLink' => '',
        ];

        switch (isset($args['askNewTeamLinkType']) ? $args['askNewTeamLinkType'] : '') {
            case 'cid':
                if (isset($args['askNewTeamCID']) && ((is_string($args['askNewTeamCID']) && is_numeric($args['askNewTeamCID'])) || is_int($args['askNewTeamCID']))) {
                    $i = (int) $args['askNewTeamCID'];
                    if ($i > 0) {
                        $normalized['askNewTeamCID'] = $i;
                    }
                }
                break;
            case 'link':
                if (isset($args['askNewTeamLink']) && is_string($args['askNewTeamLink'])) {
                    $normalized['askNewTeamLink'] = trim($args['askNewTeamLink']);
                }
                break;
            }

        return $error->has() ? $error : $normalized;
    }
1124580
public function vars($args)
    {
        $this->_query .= implode(',', array_fill(0, count($args), '?'));
        foreach ($args as $arg) {
            $this->_args[] = $arg;
        };
        return $this;
    }
614704
public static function nonEmptyStrs( ...$args ) {
		if ( !isset( $args[0] ) ) {
			return false;
		}
		foreach ( $args as $arg ) {
			if ( !self::nonEmptyStr( $arg ) ) {
				return false;
			}
		}
		// If we're still here, all are good
		return true;
	}
314805
public function validate($args)
    {
        $check = $this->normalizeArgs(is_array($args) ? $args : []);

        return is_array($check) ? true : $check;
    }
1342230
public function hasJson(...$args): bool
    {
        if (!count($args)) {
            return $this->exists('json');
        }

        return $this->exists('json', ...$args);
    }
1298412
public function update( array $args ) {

		$wp = $args ? reset( $args ) : NULL;

		if ( ! $wp instanceof \WP ) {
			return new NullLog();
		}

		$error = [];
		isset( $wp->query_vars[ 'error' ] ) and $error[] = $wp->query_vars[ 'error' ];
		is_404() and $error[] = '404 Page not found';

		if ( empty( $error ) ) {
			return new NullLog();
		}

		$url     = filter_var( add_query_arg( [] ), FILTER_SANITIZE_URL );
		$message = "Error on frontend request for url {$url}.";
		$context = [
			'error'        => $error,
			'query_vars'   => $wp->query_vars,
			'matched_rule' => $wp->matched_rule,
		];

		return new Debug( $message, Channels::HTTP, $context );
	}
1317559
public function executeAll(...$args)
    {
        if ($this->isEmpty()) {
            return 0;
        }

        $n = 0;
        do {
            if ($cb = $this->shift()) {
                $cb(...$args);
                ++$n;
                if ($cb instanceof CallbackWrapper) {
                    $cb->cancel();
                }
            }
        } while (!$this->isEmpty());
        return $n;
    }
1189977
public function mergeArgsAndParams(array $args, array $params = null)
    {

        if ($params) {
            foreach ($args as &$arg) {
                if (is_array($arg)) {
                    foreach ($params as &$param) {
                        if (is_array($param)) {
                            $arg = $param;
                            unset($param);
                            break;
                        }
                    }
                }
            }
        }

        if (is_array($params)) {
            return array_merge($args, $params);
        }

        return $args;
    }