diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2015-11-19 23:09:31 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-23 09:06:35 +0100 |
commit | 8d9353a640a6c5c9e807e70a435cc97f9de7b71b (patch) | |
tree | 67a2d0427191a1fb7be93e7953b522692a292065 /core/command | |
parent | 2f89eef334bd445a7e046d845d5d5d1b3e4b6b8c (diff) | |
download | nextcloud-server-8d9353a640a6c5c9e807e70a435cc97f9de7b71b.tar.gz nextcloud-server-8d9353a640a6c5c9e807e70a435cc97f9de7b71b.zip |
Add cmdline key to show shipped/non-shipped apps only
Diffstat (limited to 'core/command')
-rw-r--r-- | core/command/app/listapps.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/command/app/listapps.php b/core/command/app/listapps.php index e483037d45d..542420ee6b7 100644 --- a/core/command/app/listapps.php +++ b/core/command/app/listapps.php @@ -25,6 +25,7 @@ namespace OC\Core\Command\App; use OC\Core\Command\Base; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class ListApps extends Base { @@ -34,16 +35,32 @@ class ListApps extends Base { $this ->setName('app:list') ->setDescription('List all available apps') + ->addOption( + 'shipped', + null, + InputOption::VALUE_REQUIRED, + 'true - limit to shipped apps only, false - limit to non-shipped apps only' + ) ; } protected function execute(InputInterface $input, OutputInterface $output) { + if ($input->getOption('shipped') === 'true' || $input->getOption('shipped') === 'false'){ + $shouldFilterShipped = true; + $shippedFilter = $input->getOption('shipped') === 'true'; + } else { + $shouldFilterShipped = false; + } + $apps = \OC_App::getAllApps(); $enabledApps = $disabledApps = []; $versions = \OC_App::getAppVersions(); //sort enabled apps above disabled apps foreach ($apps as $app) { + if ($shouldFilterShipped && \OC_App::isShipped($app) !== $shippedFilter){ + continue; + } if (\OC_App::isEnabled($app)) { $enabledApps[] = $app; } else { |