aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_completion.d/path.bash14
1 files changed, 11 insertions, 3 deletions
diff --git a/bash/bash_completion.d/path.bash b/bash/bash_completion.d/path.bash
index ce494bd4..7143b448 100644
--- a/bash/bash_completion.d/path.bash
+++ b/bash/bash_completion.d/path.bash
@@ -6,10 +6,18 @@ _path() {
# Complete operation as first word
local cmd
- for cmd in list insert append remove shift pop check help ; do
- [[ $cmd == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue
+ while read -r cmd ; do
COMPREPLY[${#COMPREPLY[@]}]=$cmd
- done
+ done < <(compgen -W '
+ append
+ check
+ help
+ insert
+ list
+ pop
+ remove
+ shift
+ ' -- "${COMP_WORDS[COMP_CWORD]}")
# Complete with either directories or $PATH entries as all other words
else