From d70d0b889e8e613a8d47fbf909298b18115717ea Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 1 Nov 2018 17:18:48 -0700 Subject: [PATCH] Fixed count of commands list for bin/plugin --- bin/plugin | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/plugin b/bin/plugin index a219655b6..9cb75666f 100755 --- a/bin/plugin +++ b/bin/plugin @@ -91,6 +91,7 @@ if (!$name) { $output->writeln(" {$bin} error log -l 1 --trace"); $list = Folder::all('plugins://', ['compare' => 'Pathname', 'pattern' => '/\/cli\/' . $pattern . '$/usm', 'levels' => 2]); + $total = 0; if (count($list)) { $available = []; $output->writeln(''); @@ -99,13 +100,15 @@ if (!$name) { $split = explode('/', $entry); $entry = array_shift($split); $index = str_pad($index++ + 1, 2, '0', STR_PAD_LEFT); - + $total = str_pad($total++ + 1, 2, '0', STR_PAD_LEFT); if (in_array($entry, $available)) { + $total -= 1; continue; } $available[] = $entry; - $output->writeln(' ' . $index . '. ' . str_pad($entry, 15) . " ${bin} ${entry} list"); + $commands_count = $index - $total + 1; + $output->writeln(' ' . $total . '. ' . str_pad($entry, 15) . " ${bla} ${bin} ${entry} list"); } }