specify extra arguments to pass to sftp only (e.g. -f, -l)

@param string|array $sftpExtraArgs
@return AnsiblePlaybookInterface
555333
public function sftpExtraArgs($sftpExtraArgs): AnsiblePlaybookInterface
    {
        $sftpExtraArgs = $this->checkParam($sftpExtraArgs, ',');
        $this->addOption('--sftp-extra-args', $sftpExtraArgs);

        return $this;
    }
539994
public function setArguments(array $arguments)
    {
        switch ($this->argumentsType) {
            case self::ARGUMENTS_TYPE_EMPTY:
                if (!empty($arguments)) {
                    throw new InvalidCommandArgumentException($this, $arguments);
                }
                $arguments = [];
                break;
            case self::ARGUMENTS_TYPE_STRING:
                $this->checkStringArgument($arguments);
                $arguments = [$arguments[0]];
                break;
            case self::ARGUMENTS_TYPE_STRING_INT:
                $this->checkStringArgument($arguments, 2);
                if (!is_int($arguments[1])) {
                    throw new InvalidCommandArgumentException($this, $arguments);
                }
                $arguments = [$arguments[0], (int) $arguments[1]];
                break;
            case self::ARGUMENTS_TYPE_STRINGS:
                $this->checkStringArguments($arguments);
                break;
            // A fallback in case a non-existing argument type is defined.
            // This could be prevented by using an Enum as the argument type
            default:
                throw new InvalidCommandArgumentException($this, $arguments);
        }
        $this->arguments = $arguments;
    }
620575
function getExtensionArgs($request = null)
    {
        $ns_args = array();
        if (count($this->auth_policies) > 0) {
            $ns_args['auth_policies'] = implode(' ', $this->auth_policies);
        } else {
            $ns_args['auth_policies'] = 'none';
        }

        if ($this->nist_auth_level !== null) {
            if (!in_array($this->nist_auth_level, range(0, 4), true)) {
                return false;
            }
            $ns_args['nist_auth_level'] = strval($this->nist_auth_level);
        }

        if ($this->auth_time !== null) {
            if (!preg_match(PAPE_TIME_VALIDATOR, $this->auth_time)) {
                return false;
            }

            $ns_args['auth_time'] = $this->auth_time;
        }

        return $ns_args;
    }
279126
private static function checkArgs(array $args) {
        if ($_FILES) {
            foreach ($_FILES as $key => $f) {
                if (is_array($f['name'])) {
                    foreach ($f['tmp_name'] as $tmp) {
                        $args[ $key ][] = self::getfileSha1('@"' . $tmp . '"');
                    }
                } else {
                    $args[ $key ] = self::getfileSha1('@"' . $f['tmp_name'] . '"');
                }
            }
        }

        return $args;
    }
835066
private function forwardSet(OperationArguments $args)
    {
        if ($args->has('expiry')) {
            if ($args->has('casToken')) {
                return $this->setInternal($args->getKey(), $args->getValue(), $args->getExpiry(), $args->getCasToken());
            }
            return $this->setInternal($args->getKey(), $args->getValue(), $args->getExpiry());
        }
        return $this->setInternal($args->getKey(), $args->getValue());
    }
1070804
public function formatArgs(array $args)
    {
        $result = [];
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $parts = explode('\\', $item[1]);
                $short = array_pop($parts);
                $formattedValue = sprintf('<em>object</em>(<abbr title="%s">%s</abbr>)', $item[1], $short);
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('string' === $item[0]) {
                $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset()));
            } elseif ('null' === $item[0]) {
                $formattedValue = '<em>null</em>';
            } elseif ('boolean' === $item[0]) {
                $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
            } elseif ('resource' === $item[0]) {
                $formattedValue = '<em>resource</em>';
            } else {
                $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES, $this->getCharset()), true));
            }

            $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
        }

        return implode(', ', $result);
    }
1316678
public function extractArgs($args)
	{
		foreach ($args as $k => $v) {
			if (property_exists($this, $k)) {
				$this->$k = $v;
			} else {
				throw new \InvalidArgumentException("{$k} is not a valid option.");
			}
		}
	}
1326299
public function getCommand($hostConnection = true)
    {
        if (is_null($this->username)) {
            throw new \InvalidArgumentException("You must specify a SSH username");
        }

        if (is_null($this->host)) {
            throw new \InvalidArgumentException("You must specify a SSH host to connect");
        }

        $command = new Command($this->executable);

        if ($this->port != 22) {
            $command->addArgument("p", $this->port);
        }

        if (!is_null($this->privateKey)) {
            $command->addArgument("i", $this->privateKey);
        }

        if ($hostConnection) {
            $command->addParameter($this->getHostConnection());
        }

        return $command;
    }
1205521
private function escapeArgs(&$args) {
    $escaped = array();
    foreach ($args as $arg) {
      $escaped[] = escapeshellarg($arg);
    }
    return $escaped;
  }
910924
public function exec($arguments) {
        //parse
        $options = $this->parse();

        // check if help was requested
        if(is_integer($options)) {
            return $options;
        }

        // extract and remove special vars
        $instance = $options["__instance"];
        $method   = $options["__method"];

        unset($options["__instance"]);
        unset($options["__method"]);

        // execute action - print error on failure
        try {
            return (int)Misc::reflectionFunction([ $instance, $method ], self::adjustOptions($options));
        }
        catch(Exception $e) {
            return $this->printError($e->getMessage());
        }
    }
128385
public function setExtraHosts(array $extraHosts)
    {
        $this->extraHosts = $extraHosts;

        $this->hostConfig = array_merge($this->hostConfig, ['ExtraHosts' => $extraHosts]);

        return $this;
    }
487650
public function formatArgs($args)
    {
        $result = [];
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $parts = explode('\\', $item[1]);
                $short = array_pop($parts);
                $formattedValue = sprintf('<em>object</em>(<abbr title="%s">%s</abbr>)', $item[1], $short);
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('null' === $item[0]) {
                $formattedValue = '<em>null</em>';
            } elseif ('boolean' === $item[0]) {
                $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
            } elseif ('resource' === $item[0]) {
                $formattedValue = '<em>resource</em>';
            } else {
                $formattedValue = str_replace("\n", '', htmlspecialchars(var_export($item[1], true), ENT_COMPAT | ENT_SUBSTITUTE, $this->charset));
            }

            $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
        }

        return implode(', ', $result);
    }
533259
public function parseArguments(array $args)
    {
        $this->action = null;
        $this->arguments = array();
        $parsed = array();
        $argument = reset($args);
        while ($argument) {
            if (strpos($argument, '=') > 0) {
                $arg = explode('=', $argument);
                $argKey = ltrim($arg[0], '-');
                $argValue = trim($arg[1], '"');
                $parsed[$argKey] = $argValue;
            } else {
                $parsed[ltrim($argument, '-')] = true;
            }
            $argument = next($args);
        }
        if (!isset($parsed['action']) || empty($parsed['action'])) {
            if (isset($parsed['version']) ||  isset($parsed['V'])) {
                $this->action = 'Version';
                $this->arguments = $parsed;
                return $this->arguments;
            }
            if (isset($parsed['help']) || isset($parsed['h'])) {
                $this->action = 'Help';
                $this->arguments = $parsed;
                return $this->arguments;
            }
            throw new RequestException($this, "No valid action argument specified.");
        }
        $this->action = $parsed['action'];
        unset($parsed['action']);
        $this->arguments = $parsed;
        return $this->arguments;
    }
902500
public static function escapeArguments(array $arguments, $command = null)
    {
        $processedArguments = array();
        foreach ($arguments as $key => $value) {
            if (is_string($key) && substr($key, 0, 1) === '-') {
                if (is_array($value) === false) {
                    $value = array($value);
                }

                foreach ($value as $optionValue) {
                    if ($optionValue === null) {
                        $processedArguments[] = $key;
                    } elseif (is_string($optionValue)) {
                        $processedArguments[] = trim(sprintf('%s=%s', $key, $optionValue));
                    }
                }
            } elseif (is_scalar($value)) {
                $processedArguments[] = $value;
            }
        }

        if ($command !== null) {
            array_unshift($processedArguments, $command);
        }

        return implode(' ', array_map(array(__CLASS__, 'escapeArgument'), $processedArguments));
    }
1095749
public static function t($msg, $args = array())
    {
        assert('is_string($msg)');
        if (extension_loaded('gettext')) {
            bindtextdomain("phptoolkit", dirname(dirname(__DIR__)).'/locale');
            textdomain('phptoolkit');

            $translatedMsg = gettext($msg);
        } else {
            $translatedMsg = $msg;
        }
        if (!empty($args)) {
            $params = array_merge(array($translatedMsg), $args);
            $translatedMsg = call_user_func_array('sprintf', $params);
        }
        return $translatedMsg;
    }
1331403
public function withExtensions(Ext\Extension ...$exts): Extensions
    {
        $obj = clone $this;
        foreach ($exts as $ext) {
            $obj->_extensions[$ext->oid()] = $ext;
        }
        return $obj;
    }
1008842
private function getArgs(array $args, $cmd, $response, $driverId)
    {
        $response = array($response);
        $allowedArgs = $this->commands[$cmd];
        unset($allowedArgs['interface']);
        foreach ($allowedArgs as $key => $value) {
            if (isset($args[$key])) {
                $response[$key] = $args[$key];
                if (isset($this->filenameInRequest[$key])) {
                    $response[$key] = self::getNameByTarget($args[$key], $driverId);
                } elseif ($key == 'targets') {
                    $response[$key] = array_map(
                        function ($val) use ($driverId) {
                            return self::getNameByTarget($val, $driverId);
                        },
                        $args[$key]
                    );
                }
            } elseif (isset($this->defaultValues[$key])) {
                $response[$key] = $this->defaultValues[$key];
            } elseif ($value) {
                $this->error(sprintf('parameter "%s" in cmd "%s" required', $key, $cmd));
            }
        }

        return $response;
    }