aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-02 21:51:17 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-02 21:51:17 +1300
commit743523eb8e882a5f7452f94a6f49340a948b1105 (patch)
treeb2991b3f6d9760dd25a69e0bc92299d5a543dd42
parentCorrect find(1) completion to subshell exit (diff)
downloaddotfiles-743523eb8e882a5f7452f94a6f49340a948b1105.tar.gz
dotfiles-743523eb8e882a5f7452f94a6f49340a948b1105.zip
Add some comments to keep() completion
-rw-r--r--bash/bash_completion.d/keep.bash4
1 files changed, 4 insertions, 0 deletions
diff --git a/bash/bash_completion.d/keep.bash b/bash/bash_completion.d/keep.bash
index c7144684..4b479eca 100644
--- a/bash/bash_completion.d/keep.bash
+++ b/bash/bash_completion.d/keep.bash
@@ -46,9 +46,13 @@ _keep() {
# Build list of kept names
bashkeep=${BASHKEEP:-"$HOME"/.bashkeep.d}
for keep in "$bashkeep"/"$2"*.bash ; do
+ # Skip directories
! [[ -d $keep ]] || continue
+ # Strip leading path
keep=${keep##*/}
+ # Strip trailing extension
keep=${keep%.bash}
+ # Print kept name
printf '%s\n' "$keep"
done
;;