diff options
author | Igor Murzov <e-mail@date.by> | 2011-12-04 02:39:32 +0400 |
---|---|---|
committer | Igor Murzov <e-mail@date.by> | 2011-12-04 02:41:46 +0400 |
commit | 7a1a3da08a77de2952b75dc514fa962d874c5c95 (patch) | |
tree | 9c0d10262a4292f92a3cbca1da0d9d69a6c8f56e | |
parent | 9a72c2f3e00e1cbbb1dbda6dc1f65e8276e35724 (diff) | |
download | bash-completion-7a1a3da08a77de2952b75dc514fa962d874c5c95.tar.gz |
umount: Half-fix for completion of relative paths.
-rw-r--r-- | completions/umount.linux | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/completions/umount.linux b/completions/umount.linux index 13a923c1..3fbd544d 100644 --- a/completions/umount.linux +++ b/completions/umount.linux @@ -65,6 +65,18 @@ _linux_fstab() fi done + # Add some relative paths to COMPREPLY + if [[ $cur && $cur != /* ]]; then + local i n=${#COMPREPLY[@]} + for (( i=0; i < $n; i++ )); do + if [[ "${COMPREPLY[i]}" == "$PWD"* ]]; then + [[ $cur == ./* ]] && + COMPREPLY+=( "./${COMPREPLY[i]##$PWD*(/)}" ) || + COMPREPLY+=( "${COMPREPLY[i]##$PWD*(/)}" ) + fi + done + fi + _reply_compgen_array } |