aboutsummaryrefslogtreecommitdiffstats
path: root/bash-completion
diff options
context:
space:
mode:
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>2025-08-27 23:26:42 -0400
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>2025-08-27 23:41:42 -0400
commit1a76e3e69c43ae60126d4ebdbde3ca5c555c25b9 (patch)
treec38c60ec76e0c519f69d2c8faf18bf1adef93a31 /bash-completion
parentc42f264120d9c12bdf4df0b31481b49b33540f68 (diff)
downloadutil-linux-1a76e3e69c43ae60126d4ebdbde3ca5c555c25b9.tar.gz
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 <cgoesc2@wgu.edu>
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