*/
use OC\Console\Application;
+use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
define('OC_CONSOLE', 1);
}
$application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest());
- $application->loadCommands(new ConsoleOutput());
+ $application->loadCommands(new ArgvInput(), new ConsoleOutput());
$application->run();
} catch (Exception $ex) {
echo "An unhandled exception has been thrown:" . PHP_EOL;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
}
/**
+ * @param InputInterface $input
* @param OutputInterface $output
* @throws \Exception
*/
- public function loadCommands(OutputInterface $output) {
+ public function loadCommands(InputInterface $input, OutputInterface $output) {
// $application is required to be defined in the register_command scripts
$application = $this->application;
+ $inputDefinition = $application->getDefinition();
+ $inputDefinition->addOption(
+ new InputOption(
+ 'no-warnings',
+ null,
+ InputOption::VALUE_NONE,
+ 'Skip global warnings, show command output only',
+ null
+ )
+ );
+ try {
+ $input->bind($inputDefinition);
+ } catch (\RuntimeException $e) {
+ //expected if there are extra options
+ }
+ if ($input->getOption('no-warnings')) {
+ $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
+ }
require_once __DIR__ . '/../../../core/register_command.php';
if ($this->config->getSystemValue('installed', false)) {
if (\OCP\Util::needUpgrade()) {