summaryrefslogtreecommitdiff
path: root/completions/umount
blob: 6c15182b60c224ce3f25ef49a5d75794a8dd5f47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# umount(8) completion                                     -*- shell-script -*-

if [[ $OSTYPE == *linux* ]]; then
    . "$BASH_SOURCE.linux"
    return
fi

# umount(8) completion. This relies on the mount point being the third
# space-delimited field in the output of mount(8)
#
_umount()
{
    local cur prev words cword
    _init_completion || return

    local IFS=$'\n'
    COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) )
} &&
complete -F _umount -o dirnames umount

# ex: ts=4 sw=4 et filetype=sh