From: Christian Goeschel Ndjomouo Date: Thu, 28 Aug 2025 03:26:42 +0000 (-0400) Subject: bash-completion: add fallback to filename expansion for umount X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a76e3e69c43ae60126d4ebdbde3ca5c555c25b9;p=thirdparty%2Futil-linux.git bash-completion: add fallback to filename expansion for umount If the user defined path can not be found in the mount table fallback to simple filename expansion. Addresses: #1333 Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/bash-completion/umount b/bash-completion/umount index 35e86d909..9ea126bac 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