seedproject-web/api/commands/GreetCommand.php
Carlos Arias 1559ce017d chore: scaffold SeedProject base (Phase 1)
Clean-room copy of the reusable engines from comiida, with all
instance data, secrets, dependencies, and build output excluded:
- app/         Astro theme skeleton (no comiida blog posts; hero image -> placeholder)
- api/         SeedProject PHP framework (no vendor/.env/config.php)
- content-pipeline/  engine only (scripts/admin/prompts; empty runtime state)
- astroagent.config.json + app/.astroagent/skills

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SYHWLHihq3v9nxNwoPCKSn
2026-07-04 22:53:10 +00:00

55 lines
No EOL
1.6 KiB
PHP

<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class GreetCommand extends Command
{
protected $commandName = 'app:greet';
protected $commandDescription = "Greets Someone";
protected $commandArgumentName = "name";
protected $commandArgumentDescription = "Who do you want to greet?";
protected $commandOptionName = "cap"; // should be specified like "app:greet John --cap"
protected $commandOptionDescription = 'If set, it will greet in uppercase letters';
protected function configure()
{
$this
->setName($this->commandName)
->setDescription($this->commandDescription)
->addArgument(
$this->commandArgumentName,
InputArgument::OPTIONAL,
$this->commandArgumentDescription
)
->addOption(
$this->commandOptionName,
null,
InputOption::VALUE_NONE,
$this->commandOptionDescription
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$name = $input->getArgument($this->commandArgumentName);
if ($name) {
$text = 'Hello '.$name;
} else {
$text = 'Hello';
}
if ($input->getOption($this->commandOptionName)) {
$text = strtoupper($text);
}
$output->writeln($text);
return Command::SUCCESS;
}
}