Просмотр исходного кода

Tweaks and add new args to docs, refs #4663

Jordi Boggiano 9 лет назад
Родитель
Сommit
4fbf15e6d6
2 измененных файлов с 6 добавлено и 3 удалено
  1. 3 0
      doc/03-cli.md
  2. 3 3
      src/Composer/Command/DependsCommand.php

+ 3 - 0
doc/03-cli.md

@@ -342,6 +342,9 @@ symfony/symfony requires monolog/monolog (~1)
 
 * **--link-type:** The link types to match on, can be specified multiple
   times.
+* **--match-constraint (-m):** Filters the dependencies shown using this constraint.
+* **--invert-match-constraint (-i):** Turns --match-constraint around into a blacklist
+  insteead of a whitelist.
 
 ## validate
 

+ 3 - 3
src/Composer/Command/DependsCommand.php

@@ -45,8 +45,8 @@ class DependsCommand extends Command
             ->setDefinition(array(
                 new InputArgument('package', InputArgument::REQUIRED, 'Package to inspect'),
                 new InputOption('link-type', '', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Link types to show (require, require-dev)', array_keys($this->linkTypes)),
-                new InputOption('match-constraint', '', InputOption::VALUE_REQUIRED, 'Constraint to match', '*'),
-                new InputOption('match-constraint-invert', '', InputOption::VALUE_NONE, 'If constraint match should be inverted'),
+                new InputOption('match-constraint', 'm', InputOption::VALUE_REQUIRED, 'Filters the dependencies shown using this constraint', '*'),
+                new InputOption('invert-match-constraint', 'i', InputOption::VALUE_NONE, 'Turns --match-constraint around into a blacklist insteead of whitelist'),
             ))
             ->setHelp(<<<EOT
 Displays detailed information about where a package is referenced.
@@ -94,7 +94,7 @@ EOT
 
         $versionParser = new VersionParser();
         $constraint = $versionParser->parseConstraints($input->getOption('match-constraint'));
-        $matchInvert = $input->getOption('match-constraint-invert');
+        $matchInvert = $input->getOption('invert-match-constraint');
 
         $messages = array();
         $outputPackages = array();