summaryrefslogtreecommitdiffstats
path: root/completions/growisofs
blob: 1ea27c21235eed3ea707a4bf0511e57ae65543d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# growisofs(1) completion                                  -*- shell-script -*-

_comp_cmd_growisofs()
{
    local cur prev words cword comp_args
    _comp_initialize -- "$@" || return

    case $prev in
        -version | -speed)
            return
            ;;
        -Z | -M)
            compopt -o nospace
            _comp_compgen_dvd_devices
            return
            ;;
        /?(r)dev/*)
            if [[ $cur == =* ]]; then
                # e.g. /dev/dvd=foo.iso, /dev/dvdrw=/dev/zero
                _comp_compgen -c "${cur#=}" filedir
                return
            fi
            ;;
    esac

    if [[ $cur == -* ]]; then
        # TODO: mkisofs options
        _comp_compgen -- -W '-dvd-compat -overburn -speed= -Z -M'
        [[ ${COMPREPLY-} == *= ]] && compopt -o nospace
        return
    fi

    _comp_compgen_filedir
} &&
    complete -F _comp_cmd_growisofs growisofs

# ex: filetype=sh