aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_completion.d/keep.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bash_completion.d/keep.bash')
-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
;;