diff options
author | Joas Schilling <coding@schilljs.com> | 2022-09-26 15:44:39 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-09-26 15:46:36 +0300 |
commit | a02efa1dc772bc81c4a878ce1038859425a9a6f9 (patch) | |
tree | c6c88126dd2563f9ce0ea10830d3e4f02f849011 | |
parent | 612d51ebe0847de29398b27c1e12921983be8169 (diff) |
Default to exit with 0feature/7451/get-detailed-participant-count
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | lib/Command/ActiveCalls.php | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a02f2c533..0538f35c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## 15.0.0-rc.2 – 2022-… +### Breaking +- The talk:active-calls command exists with 0 now in call cases by default. There is an --non-zero option to restore the old behaviour which exists with a non-zero code when there is at least one call active + ## 15.0.0-rc.1 – 2022-09-22 ### Added - Implement the new dashboard widget modes diff --git a/lib/Command/ActiveCalls.php b/lib/Command/ActiveCalls.php index 57a3bc12c..f3329ea96 100644 --- a/lib/Command/ActiveCalls.php +++ b/lib/Command/ActiveCalls.php @@ -51,6 +51,12 @@ class ActiveCalls extends Base { InputOption::VALUE_NONE, 'List the number of participants per call' ) + ->addOption( + 'non-zero', + null, + InputOption::VALUE_NONE, + 'Exit with a non-zero exit code when at least one call is active' + ) ; } @@ -100,7 +106,7 @@ class ActiveCalls extends Base { $data = ['calls' => $numCalls, 'participants' => $numParticipants]; $this->writeArrayInOutputFormat($input, $output, $data); } - return 1; + return $input->getOption('non-zero') ? 1 : 0; } protected function executeDetails(InputInterface $input, OutputInterface $output): int { @@ -142,6 +148,6 @@ class ActiveCalls extends Base { } $this->writeArrayInOutputFormat($input, $output, $data); - return empty($data) ? 0 : 1; + return (!empty($data) && $input->getOption('non-zero')) ? 1 : 0; } } |