{% extends "base/class.php.twig" %}

{% block file_path %}
Drupal\{{module_name}}\Command\{{ name.class }}.
{% endblock %}

{% block namespace_class %}
namespace Drupal\{{module_name}}\Command;
{% endblock %}

{% block use_class %}
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;
{% endblock %}

{% block class_declaration %}
class {{ name.class }} extends Command
{% endblock %}

{% block class_methods %}
  /**
   * {@inheritdoc}
   */
  protected function configure() {
    $this
      ->setName('{{ command }}')
      ->setDescription('Greet someone')
      ->addArgument('name', InputArgument::OPTIONAL, 'Who do you want to greet?')
      ->addOption('yell', NULL, InputOption::VALUE_NONE, 'If set, the task will yell in uppercase letters');
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    $name = $input->getArgument('name');
    if ($name) {
      $text = 'Hello ' . $name;
    }
    else {
      $text = 'Hello';
    }

    if ($input->getOption('yell')) {
      $text = strtoupper($text);
    }

    $output->writeln($text);
  }
{% endblock %}

{% extends "base/class.php.twig" %}

{% block file_path %}
Drupal\{{module_name}}\Command\{{ name.class }}.
{% endblock %}

{% block namespace_class %}
namespace Drupal\{{module_name}}\Command;
{% endblock %}

{% block use_class %}
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;
use Drupal\AppConsole\Command\ContainerAwareCommand;
{% endblock %}

{% block class_declaration %}
class {{ name.class }} extends ContainerAwareCommand
{% endblock %}

{% block class_methods %}
  /**
   * {@inheritdoc}
   */
  protected function configure() {
    $this
      ->setName('{{ command }}')
      ->setDescription('Greet someone')
      ->addArgument('name', InputArgument::OPTIONAL, 'Who do you want to greet?')
      ->addOption('yell', NULL, InputOption::VALUE_NONE, 'If set, the task will yell in uppercase letters');
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    $name = $input->getArgument('name');
    if ($name) {
      $text = 'Hello ' . $name;
    }
    else {
      $text = 'Hello';
    }

    if ($input->getOption('yell')) {
      $text = strtoupper($text);
    }

    $output->writeln($text);
  }
{% endblock %}

Make command extends from ContainerAwareCommand
Make command extends from ContainerAwareCommand
