aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/path.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-10-21 13:54:30 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-10-21 13:54:30 +1300
commit5bfebd765f1de0bf662e1c7ea75533971e8e502f (patch)
tree34571eb06abc23e11d6633197bfe2828891106a5 /bash/bashrc.d/path.bash
parentTidy up completion considerably; no more compgen (diff)
downloaddotfiles-5bfebd765f1de0bf662e1c7ea75533971e8e502f.tar.gz
dotfiles-5bfebd765f1de0bf662e1c7ea75533971e8e502f.zip
Switch compopt back out
Damn, looks like 2.05a doesn't have compopt; put it back into the complete line
Diffstat (limited to 'bash/bashrc.d/path.bash')
-rw-r--r--bash/bashrc.d/path.bash9
1 files changed, 6 insertions, 3 deletions
diff --git a/bash/bashrc.d/path.bash b/bash/bashrc.d/path.bash
index c3e02627..bd290fb3 100644
--- a/bash/bashrc.d/path.bash
+++ b/bash/bashrc.d/path.bash
@@ -197,7 +197,6 @@ _path() {
# Complete with a directory
insert|i|append|add|a|check|c|set|s)
- compopt -o filenames
local dirname
while IFS= read -d '' -r dirname ; do
[[ $dirname == "${COMP_WORDS[COMP_CWORD]}"/* ]] \
@@ -223,7 +222,6 @@ _path() {
# Complete with directories from PATH
remove|rm|r)
- compopt -o filenames
local -a promptarr
IFS=: read -d '' -a promptarr < <(printf '%s\0' "$PATH")
local part
@@ -242,5 +240,10 @@ _path() {
;;
esac
}
-complete -F _path path
+
+# The use of -o filenames isn't strictly correct. The first completed world
+# will actually just be a simple string, the sub-command to use. However in
+# practice it doesn't matter as it's a fixed set of strings that won't be
+# quoted anyway.
+complete -F _path -o filenames path