summaryrefslogtreecommitdiffstats
path: root/completions/xzdec
blob: 21ee6ec9eaf0ce55cc941395857222d8f4f1495a (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
# xzdec(1) completion                                      -*- shell-script -*-

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

    local noargopts='!(-*|*M*)'
    # shellcheck disable=SC2254
    case $prev in
        --memory | -${noargopts}M)
            return
            ;;
        --help | --version | -${noargopts}[hV])
            return
            ;;
    esac

    [[ $was_split ]] && return

    if [[ $cur == -* ]]; then
        _comp_compgen_help
        [[ ${COMPREPLY-} == *= ]] && compopt -o nospace
        return
    fi

    _comp_compgen_filedir xz # no lzma support here as of xz 4.999.9beta
} &&
    complete -F _comp_cmd_xzdec xzdec

# ex: filetype=sh