Fix argument naming in InstallPackageCommand for clarity (#989)

This commit is contained in:
Jerry Ma 2025-12-06 16:57:16 +08:00 committed by GitHub
parent 9ad7147155
commit d3b0f5de79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,19 +8,19 @@ use StaticPHP\DI\ApplicationContext;
use StaticPHP\Package\PackageInstaller;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand('install-pkg', 'Install additional packages', ['i', 'install-package'])]
#[AsCommand('install-pkg', 'Install additional package', ['i', 'install-package'])]
class InstallPackageCommand extends BaseCommand
{
public function configure()
{
$this->addArgument('packages', null, 'The package to install (name or path)');
$this->addArgument('package', null, 'The package to install (name or path)');
}
public function handle(): int
{
ApplicationContext::set('elephant', true);
$installer = new PackageInstaller([...$this->input->getOptions(), 'dl-prefer-binary' => true]);
$installer->addInstallPackage($this->input->getArgument('packages'));
$installer->addInstallPackage($this->input->getArgument('package'));
$installer->run(true, true);
return static::SUCCESS;
}