Skip to content

Commit 0463b32

Browse files
committed
docs: Fix usage error for 'core.stacktrace_print'
1 parent ab3d65b commit 0463b32

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

bake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ __bake_main() {
311311
__bake_internal_die 'Failed to shift'
312312
fi
313313

314-
# shellcheck disable=SC1007
315314
local __bake_key= __bake_value=
316315
local __bake_arg=
317316
for __bake_arg; do case $__bake_arg in

docs/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ Prints stacktrace
133133
#### Example
134134

135135
```bash
136-
core.trap_add 'err_handler' EXIT
137136
err_handler() {
138137
local exit_code=$?
139138
core.stacktrace_print
140-
exit $?
139+
exit $exit_code
141140
}
141+
core.trap_add 'err_handler' EXIT
142142
```
143143

144144
_Function has no arguments._

pkg/src/public/bash-core.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ core.err_exists() {
246246
# @description Prints stacktrace
247247
# @noargs
248248
# @example
249-
# core.trap_add 'err_handler' EXIT
250249
# err_handler() {
251250
# local exit_code=$?
252251
# core.stacktrace_print
253-
# exit $?
252+
# exit $exit_code
254253
# }
254+
# core.trap_add 'err_handler' EXIT
255255
core.stacktrace_print() {
256256
printf '%s\n' 'Stacktrace:'
257257

0 commit comments

Comments
 (0)