diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-06-25 17:03:19 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-07-02 15:03:18 +0200 |
commit | 2ba0819243cfe5eedf148b6ff19d5070f1ff7844 (patch) | |
tree | 08aa972fb13182e132e5d9e97fd92216e79224db /console.php | |
parent | 72b6db40435ce0407d0aafa626945d4f2380460f (diff) | |
download | nextcloud-server-2ba0819243cfe5eedf148b6ff19d5070f1ff7844.tar.gz nextcloud-server-2ba0819243cfe5eedf148b6ff19d5070f1ff7844.zip |
feat(occ): Add a --debug option to output all log levels to the output
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'console.php')
-rw-r--r-- | console.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/console.php b/console.php index 7b067a84a35..d6f5ee58efb 100644 --- a/console.php +++ b/console.php @@ -75,13 +75,21 @@ try { $eventLogger->start('console:build_application', 'Build Application instance and load commands'); $application = \OCP\Server::get(Application::class); - $application->loadCommands(new ArgvInput(), new ConsoleOutput()); + $argv = $_SERVER['argv']; + if (($key = array_search('--debug', $argv)) !== false) { + // Remove --debug option if it was passed + unset($argv[$key]); + $argv = array_values($argv); + } + + $input = new ArgvInput($argv); + $application->loadCommands($input, new ConsoleOutput()); $eventLogger->end('console:build_application'); $eventLogger->start('console:run', 'Run the command'); $application->setAutoExit(false); - $exitCode = $application->run(); + $exitCode = $application->run($input); $eventLogger->end('console:run'); |