protected function execute(InputInterface $input, OutputInterface $output)
{
$this->validateInput($input);
$project = $this->getSelectedProject();
$this->formatter = new PropertyFormatter($input);
if ($input->getOption('refresh')) {
$project->refresh();
}
$property = $input->getArgument('property');
if (!$property) {
return $this->listProperties($project->getProperties(), new Table($input, $output));
}
$value = $input->getArgument('value');
if ($value !== null) {
return $this->setProperty($property, $value, $project, $input->getOption('no-wait'));
}
switch ($property) {
case 'git':
$value = $project->getGitUrl(false);
break;
case 'url':
$value = $project->getUri(true);
break;
default:
$value = $this->api()->getNestedProperty($project, $property);
}
$output->writeln($this->formatter->format($value, $property));
return 0;
}