summaryrefslogtreecommitdiffstats
path: root/completions/xmms
blob: 49bc3811b52d58056ee5715c199917b75480fcca (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
# bash completion for xmms                                 -*- shell-script -*-

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

    local noargopts='!(-*|*[SRA]*)'
    # shellcheck disable=SC2254
    case $prev in
        --help | --version | -${noargopts}[hv])
            return
            ;;
        --toggle-shuffle | --toggle-repeat | --toggle-advance | -${noargopts}[SRA])
            _comp_compgen -- -W 'on off'
            return
            ;;
    esac

    [[ $was_split ]] && return

    if [[ $cur == -* ]]; then
        _comp_compgen_help
    else
        _comp_compgen_filedir '@(mp[23]|ogg|wav|pls|m3u|xm|mod|s[3t]m|it|mtm|ult|flac)'
    fi

} &&
    complete -F _comp_cmd_xmms xmms

# ex: filetype=sh