function RunScriptCommand::configure
Overrides Command::configure
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ RunScriptCommand.php, line 47
Class
- RunScriptCommand
- @author Fabien Potencier <fabien.potencier@gmail.com>
Namespace
Composer\CommandCode
protected function configure() : void {
$this->setName('run-script')
->setAliases([
'run',
])
->setDescription('Runs the scripts defined in composer.json')
->setDefinition([
new InputArgument('script', InputArgument::OPTIONAL, 'Script name to run.', null, function () {
return array_map(static function ($script) {
return $script['name'];
}, $this->getScripts());
}),
new InputArgument('args', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, ''),
new InputOption('timeout', null, InputOption::VALUE_REQUIRED, 'Sets script timeout in seconds, or 0 for never.'),
new InputOption('dev', null, InputOption::VALUE_NONE, 'Sets the dev mode.'),
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables the dev mode.'),
new InputOption('list', 'l', InputOption::VALUE_NONE, 'List scripts.'),
])
->setHelp(<<<EOT
The <info>run-script</info> command runs scripts defined in composer.json:
<info>php composer.phar run-script post-update-cmd</info>
Read more at https://getcomposer.org/doc/03-cli.md#run-script-run
EOT
);
}