aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/td.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/bash/bashrc.d/td.bash b/bash/bashrc.d/td.bash
index 825b5c54..d7200c87 100644
--- a/bash/bashrc.d/td.bash
+++ b/bash/bashrc.d/td.bash
@@ -7,10 +7,10 @@ _td() {
done < <(
shopt -s extglob nullglob
shopt -u dotglob
- declare -a fns
- cd -- "$dir" || exit
- fns=(*)
- ((${#fns[@]})) || exit
+ local -a fns
+ fns=("$dir"/"${COMP_WORDS[COMP_CWORD]}"*)
+ fns=("${fns[@]#$dir/}")
+ ((${#fns[@]})) || exit 1
printf '%s\0' "${fns[@]##$dir/}"
)
return