docs: update
This commit is contained in:
parent
a2c0d36e19
commit
9dd64366d9
|
@ -641,6 +641,8 @@ fi
|
||||||
Enabling `extdebug` allows access to the `BASH_ARGV` array which stores
|
Enabling `extdebug` allows access to the `BASH_ARGV` array which stores
|
||||||
the current function’s arguments in reverse.
|
the current function’s arguments in reverse.
|
||||||
|
|
||||||
|
**CAVEAT**: Requires `shopt -s compat44` in `bash` 5.0+.
|
||||||
|
|
||||||
**Example Function:**
|
**Example Function:**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|
2
test.sh
2
test.sh
|
@ -69,8 +69,10 @@ test_urldecode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
test_reverse_array() {
|
test_reverse_array() {
|
||||||
|
shopt -s compat44
|
||||||
IFS=$'\n' read -d "" -ra result < <(reverse_array 1 2 3 4 5)
|
IFS=$'\n' read -d "" -ra result < <(reverse_array 1 2 3 4 5)
|
||||||
assert_equals "${result[*]}" "5 4 3 2 1"
|
assert_equals "${result[*]}" "5 4 3 2 1"
|
||||||
|
shopt -u compat44
|
||||||
}
|
}
|
||||||
|
|
||||||
test_remove_array_dups() {
|
test_remove_array_dups() {
|
||||||
|
|
Loading…
Reference in New Issue