Refactor to separate commands
This commit is contained in:
parent
1350899e8f
commit
b4e7a71fe3
7 changed files with 271 additions and 159 deletions
35
src/Console/Command/AbstractCommand.php
Normal file
35
src/Console/Command/AbstractCommand.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
abstract class AbstractCommand extends Command
|
||||
{
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->addOption(
|
||||
name: 'extra-args',
|
||||
shortcut: 'a',
|
||||
mode: InputArgument::OPTIONAL,
|
||||
description: 'Any additonal arguments to pass to the command.',
|
||||
);
|
||||
|
||||
$this->addOption(
|
||||
name: 'type',
|
||||
shortcut: 't',
|
||||
mode: InputArgument::OPTIONAL,
|
||||
description: 'The project type',
|
||||
suggestedValues: ['drupal', 'sculpin'],
|
||||
);
|
||||
|
||||
$this->addOption(
|
||||
name: 'working-dir',
|
||||
shortcut: 'd',
|
||||
mode: InputArgument::OPTIONAL,
|
||||
description: 'The project\'s working directory',
|
||||
default: '.',
|
||||
);
|
||||
}
|
||||
}
|
Reference in a new issue