aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_completion.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-09 10:54:17 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-09 10:54:17 +1300
commitdb538445b1aa72c45300d05eb24794a435f27774 (patch)
treededb101ef0ef2c63448a2791a0eff2e19b9997bb /bash/bash_completion.d
parentAdd missing full stop to README (diff)
downloaddotfiles-db538445b1aa72c45300d05eb24794a435f27774.tar.gz
dotfiles-db538445b1aa72c45300d05eb24794a435f27774.zip
Prevent man(1) completion interfering with paths
Diffstat (limited to 'bash/bash_completion.d')
-rw-r--r--bash/bash_completion.d/man.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/bash/bash_completion.d/man.bash b/bash/bash_completion.d/man.bash
index 9861e9dd..7d25fdd2 100644
--- a/bash/bash_completion.d/man.bash
+++ b/bash/bash_completion.d/man.bash
@@ -8,6 +8,12 @@ _man() {
local word
word=${COMP_WORDS[COMP_CWORD]}
+ # Don't bother if the word has slashes in it, the user is probably trying
+ # to complete an actual path
+ case $word in
+ */*) return 1 ;;
+ esac
+
# If this is the second word, and the previous word started with a number,
# we'll assume that's the section to search
local section subdir