diff options
Diffstat (limited to 'core/Command/L10n/CreateJs.php')
-rw-r--r-- | core/Command/L10n/CreateJs.php | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/core/Command/L10n/CreateJs.php b/core/Command/L10n/CreateJs.php index 53e897e6b43..e52f588b831 100644 --- a/core/Command/L10n/CreateJs.php +++ b/core/Command/L10n/CreateJs.php @@ -25,13 +25,15 @@ namespace OC\Core\Command\L10n; use DirectoryIterator; +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\InputOption; use Symfony\Component\Console\Output\OutputInterface; use UnexpectedValueException; -class CreateJs extends Command { +class CreateJs extends Command implements CompletionAwareInterface { protected function configure() { $this @@ -135,4 +137,32 @@ class CreateJs extends Command { return array($TRANSLATIONS, $PLURAL_FORMS); } + + /** + * Return possible values for the named option + * + * @param string $optionName + * @param CompletionContext $context + * @return string[] + */ + public function completeOptionValues($optionName, CompletionContext $context) { + return []; + } + + /** + * Return possible values for the named argument + * + * @param string $argumentName + * @param CompletionContext $context + * @return string[] + */ + public function completeArgumentValues($argumentName, CompletionContext $context) { + if ($argumentName === 'app') { + return \OC_App::getAllApps(); + } else if ($argumentName === 'lang') { + $appName = $context->getWordAtIndex($context->getWordIndex() - 1); + return $this->getAllLanguages(\OC_App::getAppPath($appName)); + } + return []; + } } |