Phrozn\Runner\CommandLine\Callback\Base::getPathArgument PHP Method

getPathArgument() protected method

Extract path argument or fallback to cwd
protected getPathArgument ( string $name, boolean $realpath = true, Console_CommandLine_Result $command = null ) : string
$name string Name of the path argument
$realpath boolean Whether to apply realpath() to path
$command Console_CommandLine_Result Command line result to use
return string
    protected function getPathArgument($name, $realpath = true, $command = null)
    {
        if (null == $command) {
            $command = $this->getParseResult()->command;
        }
        $path = isset($command->args[$name]) ? $command->args[$name] : \getcwd();
        if (!$this->isAbsolute($path)) {
            // not an absolute path
            $path = \getcwd() . '/./' . $path;
        }
        if ($realpath) {
            $path = realpath($path);
        }
        return $path;
    }