diff --git a/bin/plugin b/bin/plugin index fd68f429a..fd4540569 100755 --- a/bin/plugin +++ b/bin/plugin @@ -63,7 +63,26 @@ $output->getFormatter()->setStyle('red', new OutputFormatterStyle('red', null, a $output->getFormatter()->setStyle('white', new OutputFormatterStyle('white', null, array('bold'))); if (!$name) { - $output->writeln("A Plugin Name (slug format) is required. Example: '{$bin} error log'"); + $output->writeln(''); + $output->writeln("Usage:"); + $output->writeln(" {$bin} [slug] [command] [arguments]"); + $output->writeln(''); + $output->writeln("Example:"); + $output->writeln(" {$bin} error log -l 1 --trace"); + $list = Folder::all('plugins://', ['compare' => 'Pathname', 'pattern' => '/\/cli\/([A-Z][a-z]+Command\.php)$/usm']); + + if (count($list)) { + $available = []; + $output->writeln(''); + $output->writeln('Plugins with CLI available:'); + foreach($list as $index => $entry) { + $split = explode('/', $entry); + $entry = array_shift($split); + $index = str_pad($index++ + 1, 2, '0', STR_PAD_LEFT); + $output->writeln(' ' . $index . ". " . str_pad($entry, 15) . " ${bin} ${entry} list"); + } + } + exit; }