diff options
Diffstat (limited to 'core/Command/Log/File.php')
-rw-r--r-- | core/Command/Log/File.php | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/core/Command/Log/File.php b/core/Command/Log/File.php index ec490237400..d53484f086d 100644 --- a/core/Command/Log/File.php +++ b/core/Command/Log/File.php @@ -25,13 +25,15 @@ namespace OC\Core\Command\Log; use \OCP\IConfig; +use Stecman\Component\Symfony\Console\BashCompletion\Completion; +use Stecman\Component\Symfony\Console\BashCompletion\Completion\ShellPathCompletion; +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 File extends Command { +class File extends Command implements Completion\CompletionAwareInterface { /** @var IConfig */ protected $config; @@ -125,4 +127,31 @@ class File extends Command { } } + /** + * @param string $optionName + * @param CompletionContext $context + * @return string[] + */ + public function completeOptionValues($optionName, CompletionContext $context) { + if ($optionName === 'file') { + $helper = new ShellPathCompletion( + $this->getName(), + 'file', + Completion::TYPE_OPTION + ); + return $helper->run(); + } else if ($optionName === 'rotate-size') { + return [0]; + } + return []; + } + + /** + * @param string $argumentName + * @param CompletionContext $context + * @return string[] + */ + public function completeArgumentValues($argumentName, CompletionContext $context) { + return []; + } } |