aboutsummaryrefslogtreecommitdiffstats
path: root/bash-completion
diff options
context:
space:
mode:
Diffstat (limited to 'bash-completion')
-rw-r--r--bash-completion/umount10
1 files changed, 8 insertions, 2 deletions
diff --git a/bash-completion/umount b/bash-completion/umount
index 35e86d9090..9ea126bacf 100644
--- a/bash-completion/umount
+++ b/bash-completion/umount
@@ -83,7 +83,13 @@ _umount_module()
;;
esac
- local IFS=$'\n'
- COMPREPLY=( $( compgen -W '$( _umount_points_list )' -- "$cur" ) )
+ if command grep -q "^$cur" <(findmnt -lno TARGET); then
+ local IFS=$'\n'
+ COMPREPLY=( $( compgen -W '$( _umount_points_list )' -- "$cur" ) )
+ else
+ compopt -o filenames
+ COMPREPLY=( $(compgen -o dirnames -- "$cur") )
+ return 0
+ fi
}
complete -F _umount_module -o nospace umount