aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ud.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-30 01:17:09 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-30 02:09:30 +1200
commit4cbbd121c012b3962f12fdff0f1820c3b8636a44 (patch)
tree00149270df365ed0b7a1b9e9f4922fe7d5a80eb3 /bash/bashrc.d/ud.bash
parentChange ca from Bash func to sh script (diff)
downloaddotfiles-4cbbd121c012b3962f12fdff0f1820c3b8636a44.tar.gz
dotfiles-4cbbd121c012b3962f12fdff0f1820c3b8636a44.zip
Move bash completion setup into separate dir
Diffstat (limited to 'bash/bashrc.d/ud.bash')
-rw-r--r--bash/bashrc.d/ud.bash29
1 files changed, 0 insertions, 29 deletions
diff --git a/bash/bashrc.d/ud.bash b/bash/bashrc.d/ud.bash
index a1792968..e23de1fa 100644
--- a/bash/bashrc.d/ud.bash
+++ b/bash/bashrc.d/ud.bash
@@ -48,32 +48,3 @@ ud() {
# Try to change into it
cd "${opts[@]}" -- "$dirname"
}
-
-# Completion setup for ud
-_ud() {
-
- # Only makes sense for the second argument
- ((COMP_CWORD == 2)) || return 1
-
- # Iterate through directories, null-separated, add them to completions
- local dirname
- while IFS= read -rd '' dirname ; do
- COMPREPLY[${#COMPREPLY[@]}]=$dirname
- done < <(
-
- # Set options to glob correctly
- shopt -s dotglob nullglob
-
- # Collect directory names, strip trailing slashes
- local -a dirnames
- dirnames=("${COMP_WORDS[COMP_CWORD]}"*/)
- dirnames=("${dirnames[@]%/}")
-
- # Bail if no results to prevent empty output
- ((${#dirnames[@]})) || exit 1
-
- # Print results null-delimited
- printf '%s\0' "${dirnames[@]}"
- )
-}
-complete -F _ud -o filenames ud