use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
-use Drupal\Console\Core\Style\DrupalStyle;
+use Drupal\Console\Core\Command\Command;
use Drupal\Console\Command\Shared\ProjectDownloadTrait;
use Drupal\Console\Utils\DrupalApi;
use GuzzleHttp\Client;
class DownloadCommand extends Command
{
use ProjectDownloadTrait;
- use CommandTrait;
-
/**
* @var DrupalApi
$this
->setName('theme:download')
->setDescription($this->trans('commands.theme.download.description'))
- ->addArgument('theme', InputArgument::REQUIRED, $this->trans('commands.theme.download.arguments.theme'))
- ->addArgument('version', InputArgument::OPTIONAL, $this->trans('commands.theme.download.arguments.version'))
+ ->addArgument(
+ 'theme',
+ InputArgument::REQUIRED,
+ $this->trans('commands.theme.download.arguments.theme')
+ )
+ ->addArgument(
+ 'version',
+ InputArgument::OPTIONAL,
+ $this->trans('commands.theme.download.arguments.version')
+ )
->addOption(
'composer',
null,
InputOption::VALUE_NONE,
$this->trans('commands.theme.download.options.composer')
- );
+ )->setAliases(['thd']);
}
/**
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
-
$theme = $input->getArgument('theme');
$version = $input->getArgument('version');
$composer = $input->getOption('composer');
true
);
} else {
- $this->downloadProject($io, $theme, $version, 'theme');
+ $this->downloadProject($theme, $version, 'theme');
}
}
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
-
$theme = $input->getArgument('theme');
$version = $input->getArgument('version');
$composer = $input->getOption('composer');
if (!$version && !$composer) {
- $version = $this->releasesQuestion($io, $theme);
+ $version = $this->releasesQuestion($theme);
$input->setArgument('version', $version);
}
}