X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FCommand%2FListCommand.php;h=cd38eb59d6f6f0c7391fd899cee26a5d030120b3;hp=e463366b67da363ba39be0ddeff87cbdf5b39e3e;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/psy/psysh/src/Psy/Command/ListCommand.php b/vendor/psy/psysh/src/Psy/Command/ListCommand.php index e463366b6..cd38eb59d 100644 --- a/vendor/psy/psysh/src/Psy/Command/ListCommand.php +++ b/vendor/psy/psysh/src/Psy/Command/ListCommand.php @@ -22,6 +22,7 @@ use Psy\Command\ListCommand\PropertyEnumerator; use Psy\Command\ListCommand\TraitEnumerator; use Psy\Command\ListCommand\VariableEnumerator; use Psy\Exception\RuntimeException; +use Psy\Input\FilterOptions; use Psy\VarDumper\Presenter; use Psy\VarDumper\PresenterAware; use Symfony\Component\Console\Formatter\OutputFormatter; @@ -54,6 +55,8 @@ class ListCommand extends ReflectingCommand implements PresenterAware */ protected function configure() { + list($grep, $insensitive, $invert) = FilterOptions::getOptions(); + $this ->setName('ls') ->setAliases(array('list', 'dir')) @@ -72,9 +75,9 @@ class ListCommand extends ReflectingCommand implements PresenterAware new InputOption('properties', 'p', InputOption::VALUE_NONE, 'Display class or object properties (public properties by default).'), new InputOption('methods', 'm', InputOption::VALUE_NONE, 'Display class or object methods (public methods by default).'), - new InputOption('grep', 'G', InputOption::VALUE_REQUIRED, 'Limit to items matching the given pattern (string or regex).'), - new InputOption('insensitive', 'i', InputOption::VALUE_NONE, 'Case-insensitive search (requires --grep).'), - new InputOption('invert', 'v', InputOption::VALUE_NONE, 'Inverted search (requires --grep).'), + $grep, + $insensitive, + $invert, new InputOption('globals', 'g', InputOption::VALUE_NONE, 'Include global variables.'), new InputOption('internal', 'n', InputOption::VALUE_NONE, 'Limit to internal functions and classes.'), @@ -123,7 +126,7 @@ HELP $reflector = null; } - // TODO: something cleaner than this :-/ + // @todo something cleaner than this :-/ if ($input->getOption('long')) { $output->startPaging(); } @@ -237,15 +240,6 @@ HELP */ private function validateInput(InputInterface $input) { - // grep, invert and insensitive - if (!$input->getOption('grep')) { - foreach (array('invert', 'insensitive') as $option) { - if ($input->getOption($option)) { - throw new RuntimeException('--' . $option . ' does not make sense without --grep'); - } - } - } - if (!$input->getArgument('target')) { // if no target is passed, there can be no properties or methods foreach (array('properties', 'methods', 'no-inherit') as $option) {