forked from mirror/cobra
fix(bash-v2): activeHelp length check syntax (#1762)
```shell $ set -u $ foo=() $ echo ${#foo} bash: foo: unbound variable echo ${#foo[*]} 0 ``` The above shows that an empty array needs the suffix `[*]` when checking its length, or else it is considered unbound.
This commit is contained in:
parent
7790bf97fd
commit
f911c0b89c
|
@ -150,7 +150,7 @@ __%[1]s_process_completion_results() {
|
|||
__%[1]s_handle_special_char "$cur" =
|
||||
|
||||
# Print the activeHelp statements before we finish
|
||||
if [ ${#activeHelp} -ne 0 ]; then
|
||||
if [ ${#activeHelp[*]} -ne 0 ]; then
|
||||
printf "\n";
|
||||
printf "%%s\n" "${activeHelp[@]}"
|
||||
printf "\n"
|
||||
|
|
Loading…
Reference in New Issue