1
0
Fork 0

Merge pull request #6904 from brettsantore/doc-update

clarify optionality of package in require command
pull/6866/merge
Jordi Boggiano 2017-12-17 15:02:18 +01:00 committed by GitHub
commit 8bc02d1aed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -191,6 +191,8 @@ to the command.
php composer.phar require vendor/package:2.* vendor/package2:dev-master php composer.phar require vendor/package:2.* vendor/package2:dev-master
``` ```
If you do not specify a package, composer will prompt you to search for a package, and given results, provide a list of matches to require.
### Options ### Options
* **--dev:** Add packages to `require-dev`. * **--dev:** Add packages to `require-dev`.

View File

@ -38,7 +38,7 @@ class RequireCommand extends InitCommand
->setName('require') ->setName('require')
->setDescription('Adds required packages to your composer.json and installs them.') ->setDescription('Adds required packages to your composer.json and installs them.')
->setDefinition(array( ->setDefinition(array(
new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Required package name optionally including a version constraint, e.g. foo/bar or foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'), new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Optional package name can also include a version constraint, e.g. foo/bar or foo/bar:1.0.0 or foo/bar=1.0.0 or "foo/bar 1.0.0"'),
new InputOption('dev', null, InputOption::VALUE_NONE, 'Add requirement to require-dev.'), new InputOption('dev', null, InputOption::VALUE_NONE, 'Add requirement to require-dev.'),
new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'), new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'), new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
@ -60,6 +60,9 @@ class RequireCommand extends InitCommand
->setHelp(<<<EOT ->setHelp(<<<EOT
The require command adds required packages to your composer.json and installs them. The require command adds required packages to your composer.json and installs them.
If you do not specify a package, composer will prompt you to search for a package, and given results, provide a list of
matches to require.
If you do not specify a version constraint, composer will choose a suitable one based on the available package versions. If you do not specify a version constraint, composer will choose a suitable one based on the available package versions.
If you do not want to install the new dependencies immediately you can call it with --no-update If you do not want to install the new dependencies immediately you can call it with --no-update