From bda32d86323a097a6493c1884abd2e8a70ba1a78 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sat, 10 Oct 2020 19:53:56 +0200 Subject: [PATCH] Add option to disable regular display of operation numbers Issue: https://gitea.armuli.eu/museum-digital/MDConsole/issues/1 --- src/MDOutputHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MDOutputHandler.php b/src/MDOutputHandler.php index 264ab5a..235c7a0 100644 --- a/src/MDOutputHandler.php +++ b/src/MDOutputHandler.php @@ -23,6 +23,8 @@ final class MDOutputHandler { private bool $_file_logging = false; /** @var float */ private float $_startTime; + /** @var boolean */ + public bool $show_operation_number = true; /** * Function human_filesize translates byte-level filesizes to human readable ones. @@ -135,7 +137,7 @@ final class MDOutputHandler { if (($this->_verbosity > 0 && \in_array($statusCode, [MDConsole::STATUS_UPDATE, MDConsole::STATUS_DELETION, MDConsole::STATUS_ERROR], true)) || $this->_verbosity === 2) echo $message; - if ($this->_counter % 250 === 0) { + if ($this->show_operation_number === true && $this->_counter % 250 === 0) { echo '―――> ' . \sprintf("%1$07d", $this->_counter) . " operations processed" . PHP_EOL; echo str_replace("_", "―", sprintf("%'_80s", "_")) . PHP_EOL; }