summaryrefslogtreecommitdiffstats
path: root/core/Command/App/Disable.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-21 00:48:05 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-09-29 15:57:10 +0200
commite1df6b5702224bbbdc4ed555ecc90620ba9b0e40 (patch)
tree74fa899ba41a019ac77be73ec11e37bb3ea9bf0c /core/Command/App/Disable.php
parent5551c6311025e432525a75ecda4d99fbeec913a6 (diff)
downloadnextcloud-server-e1df6b5702224bbbdc4ed555ecc90620ba9b0e40.tar.gz
nextcloud-server-e1df6b5702224bbbdc4ed555ecc90620ba9b0e40.zip
Full support for autocomplete of app:*
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Command/App/Disable.php')
-rw-r--r--core/Command/App/Disable.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/core/Command/App/Disable.php b/core/Command/App/Disable.php
index 07e752ee839..b64e309bd97 100644
--- a/core/Command/App/Disable.php
+++ b/core/Command/App/Disable.php
@@ -26,12 +26,14 @@
namespace OC\Core\Command\App;
use OCP\App\IAppManager;
+use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface;
+use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-class Disable extends Command {
+class Disable extends Command implements CompletionAwareInterface {
/** @var IAppManager */
protected $manager;
@@ -69,4 +71,25 @@ class Disable extends Command {
$output->writeln('No such app enabled: ' . $appId);
}
}
+
+ /**
+ * @param string $optionName
+ * @param CompletionContext $context
+ * @return string[]
+ */
+ public function completeOptionValues($optionName, CompletionContext $context) {
+ return [];
+ }
+
+ /**
+ * @param string $argumentName
+ * @param CompletionContext $context
+ * @return string[]
+ */
+ public function completeArgumentValues($argumentName, CompletionContext $context) {
+ if ($argumentName === 'app-id') {
+ return array_diff(\OC_App::getEnabledApps(true, true), $this->manager->getAlwaysEnabledApps());
+ }
+ return [];
+ }
}