Extract extraArgs
and workingDir
This commit is contained in:
parent
b4e7a71fe3
commit
ee709b2966
5 changed files with 36 additions and 28 deletions
|
@ -4,9 +4,15 @@ namespace App\Console\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;
|
||||
|
||||
abstract class AbstractCommand extends Command
|
||||
{
|
||||
protected ?string $extraArgs;
|
||||
|
||||
protected string $workingDir;
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->addOption(
|
||||
|
@ -32,4 +38,12 @@ abstract class AbstractCommand extends Command
|
|||
default: '.',
|
||||
);
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$this->extraArgs = $input->getOption('extra-args');
|
||||
$this->workingDir = $input->getOption('working-dir');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue