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;
}