diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-01 13:15:28 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-01 13:15:28 +1300 |
commit | b6c540ded9a527f19b8bff7888e330ba2786f552 (patch) | |
tree | 2fdddfb9844127ee20be21b83e6fb4c749328588 /bash/bash_completion.d/sd.bash | |
parent | Overhaul bd() completion again (diff) | |
download | dotfiles-b6c540ded9a527f19b8bff7888e330ba2786f552.tar.gz dotfiles-b6c540ded9a527f19b8bff7888e330ba2786f552.zip |
Use the positional parameter aliases for words
The current word is available in $2, and the previous word in $3. That's
easier (and maybe a bit less expensive) to dig out, so let's use it.
Diffstat (limited to 'bash/bash_completion.d/sd.bash')
-rw-r--r-- | bash/bash_completion.d/sd.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bash/bash_completion.d/sd.bash b/bash/bash_completion.d/sd.bash index e7e82f80..d6e93c78 100644 --- a/bash/bash_completion.d/sd.bash +++ b/bash/bash_completion.d/sd.bash @@ -31,7 +31,7 @@ _sd() { # Collect directory names, strip leading ../ and trailing / local -a dirnames - dirnames=(../"${COMP_WORDS[COMP_CWORD]}"*/) + dirnames=(../"$2"*/) dirnames=("${dirnames[@]#../}") dirnames=("${dirnames[@]%/}") |