aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/bd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-10-21 14:28:49 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-10-21 14:28:49 +1300
commitf0812b4f1a8e987faccf85ac309a8b7c024f791c (patch)
tree7761f031bbd56c3ef47b820bf839a59fa60f901a /bash/bashrc.d/bd.bash
parentFix backwards test (diff)
downloaddotfiles-f0812b4f1a8e987faccf85ac309a8b7c024f791c.tar.gz
dotfiles-f0812b4f1a8e987faccf85ac309a8b7c024f791c.zip
Exclude stuff not a filename in current directory
Otherwise Bash adds a slash to it. %q quoting isn't perfect, but it's better
Diffstat (limited to 'bash/bashrc.d/bd.bash')
-rw-r--r--bash/bashrc.d/bd.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/bash/bashrc.d/bd.bash b/bash/bashrc.d/bd.bash
index bfef89f2..bc474901 100644
--- a/bash/bashrc.d/bd.bash
+++ b/bash/bashrc.d/bd.bash
@@ -95,8 +95,8 @@ _bd() {
local dirname
for dirname in "${dirnames[@]}" ; do
[[ $dirname == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue
- COMPREPLY=("${COMPREPLY[@]}" "$dirname")
+ COMPREPLY=("${COMPREPLY[@]}" "$(printf %q "$dirname")")
done
}
-complete -F _bd -o filenames bd
+complete -F _bd bd