Skip to content

Commit 60ac81e

Browse files
committed
chore: disable progress bar by default
1 parent 8314eb2 commit 60ac81e

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

bashunit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ while [[ $# -gt 0 ]]; do
6464
fi
6565
set -x
6666
;;
67+
-pb|--progress-bar)
68+
export BASHUNIT_PROGRESS=true
69+
;;
6770
-b|--bench)
6871
_BENCH_MODE=true
6972
export BASHUNIT_BENCH_MODE=true

docs/command-line.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,18 @@ Duration: 48 ms
340340
```
341341
:::
342342

343+
## Progress bar
344+
345+
> `bashunit -pb|--progress-bar`
346+
347+
Enable the progress bar during test execution. By default, the progress bar is disabled.
348+
349+
::: code-group
350+
```bash [Example]
351+
./bashunit --progress-bar
352+
```
353+
:::
354+
343355
## Version
344356

345357
> `bashunit --version`

docs/configuration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,18 @@ BASHUNIT_VERBOSE=true
247247
```
248248
:::
249249

250+
## Progress bar
251+
252+
> `BASHUNIT_PROGRESS=true|false`
253+
254+
Controls whether the progress bar is rendered. `false` by default.
255+
256+
::: code-group
257+
```bash [Example]
258+
BASHUNIT_PROGRESS=true
259+
```
260+
:::
261+
250262
<script setup>
251263
import pkg from '../package.json'
252264
</script>

src/env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _DEFAULT_STOP_ON_FAILURE="false"
2828
_DEFAULT_SHOW_EXECUTION_TIME="true"
2929
_DEFAULT_VERBOSE="false"
3030
_DEFAULT_BENCH_MODE="false"
31-
_DEFAULT_PROGRESS="true"
31+
_DEFAULT_PROGRESS="false"
3232

3333
# Controls if the progress bar should render during execution
3434
_PROGRESS_ENABLED=true

src/progress.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function progress::finish() {
7777
# Re-render the last progress bar if progress display is enabled
7878
function progress::refresh() {
7979
if [[ "$_PROGRESS_ENABLED" == true ]]; then
80-
progress::render "$PROGRESS_CURRENT" "$PROGRESS_TOTAL"
80+
progress::render "${PROGRESS_CURRENT:-}" "${PROGRESS_TOTAL:-}"
8181
fi
8282
}
8383

0 commit comments

Comments
 (0)