summaryrefslogtreecommitdiffstats
path: root/core/Command/Log/Manage.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/Log/Manage.php')
-rw-r--r--core/Command/Log/Manage.php33
1 files changed, 29 insertions, 4 deletions
diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php
index 554708dfa42..578e8e8dac6 100644
--- a/core/Command/Log/Manage.php
+++ b/core/Command/Log/Manage.php
@@ -24,15 +24,15 @@
namespace OC\Core\Command\Log;
-use \OCP\IConfig;
-
+use OCP\IConfig;
+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\InputInterface;
-use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-class Manage extends Command {
+class Manage extends Command implements CompletionAwareInterface {
const DEFAULT_BACKEND = 'file';
const DEFAULT_LOG_LEVEL = 2;
@@ -172,4 +172,29 @@ class Manage extends Command {
}
throw new \InvalidArgumentException('Invalid log level number');
}
+
+ /**
+ * @param string $optionName
+ * @param CompletionContext $context
+ * @return string[]
+ */
+ public function completeOptionValues($optionName, CompletionContext $context) {
+ if ($optionName === 'backend') {
+ return ['file', 'syslog', 'errorlog'];
+ } else if ($optionName === 'level') {
+ return ['debug', 'info', 'warning', 'error'];
+ } else if ($optionName === 'timezone') {
+ return \DateTimeZone::listIdentifiers();
+ }
+ return [];
+ }
+
+ /**
+ * @param string $argumentName
+ * @param CompletionContext $context
+ * @return string[]
+ */
+ public function completeArgumentValues($argumentName, CompletionContext $context) {
+ return [];
+ }
}