Kaynağa Gözat

Updated the documentation of the require command

It did not mention that it is possible to leave out the version constraint.
Carsten Brandt 10 yıl önce
ebeveyn
işleme
7e3f4805c0
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      src/Composer/Command/RequireCommand.php

+ 4 - 2
src/Composer/Command/RequireCommand.php

@@ -38,7 +38,7 @@ class RequireCommand extends InitCommand
             ->setName('require')
             ->setDescription('Adds required packages to your composer.json and installs them')
             ->setDefinition(array(
-                new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Required package with a version constraint, e.g. 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, '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 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-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
@@ -50,7 +50,9 @@ class RequireCommand extends InitCommand
                 new InputOption('sort-packages', null, InputOption::VALUE_NONE, 'Sorts packages when adding/updating a new dependency'),
             ))
             ->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 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