<?php

namespace Offy\Bundle\DashboardBundle\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class HelloWorldCommand extends Command {

    /**
     * {@inheritdoc}
     */
    protected function configure() {
        $this
                ->setName('offy:hello')
                ->setDescription('Hello World example command')
                ->addArgument('who', InputArgument::OPTIONAL, 'Who to greet.', 'Tran Thien Binh')
                ->setHelp(<<<EOF
The <info>%command.name%</info> command greets somebody or everybody:

<info>php %command.full_name%</info>

The optional argument specifies who to greet:

<info>php %command.full_name%</info> Fabien
EOF
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output) {
        $output->writeln(sprintf('Hello <comment>%s</comment>!', $input->getArgument('who')));
    }
    
}
