From 8e63eafb83342dec5a04fe3c49330c6cbe00f96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 23 Sep 2012 21:00:53 +0300 Subject: [PATCH] lvm volumes: Complete on /dev/mapper/* (RedHat: #851787). This is done only if user has typed it though. --- completions/lvm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/completions/lvm b/completions/lvm index b657e0bd..85487533 100644 --- a/completions/lvm +++ b/completions/lvm @@ -16,6 +16,13 @@ _logicalvolumes() { COMPREPLY=( $(compgen -W "$( lvscan 2>/dev/null | \ sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- "$cur" ) ) + if [[ $cur == /dev/mapper/* ]]; then + _filedir + local i + for i in ${!COMPREPLY[@]}; do + [[ ${COMPREPLY[i]} == */control ]] && unset COMPREPLY[i] + done + fi } _units()