summaryrefslogtreecommitdiff
blob: cd6e17e8fa95120e34e38000fe2533f011f9debe (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
# Gentoo Linux Bash Shell Command Completion
#
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later

#
# ebuild completion command
#
_ebuild()
{
    local cur opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"

    opts="help setup clean fetch digest manifest unpack compile test preinst \
        install postinst qmerge merge unmerge prerm postrm config package rpm \
        configure prepare"

    if [[ $COMP_CWORD -eq 1 ]] ; then
    COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) \
            $(compgen -d -- ${cur}) \
            $(compgen -W '--debug --force --help --ignore-default-opts --skip-manifest' -- ${cur}))

    elif [[ $COMP_CWORD -eq 2 && "${COMP_WORDS[1]}" = "--debug --force --ignore-default-opts --skip-manifest" ]] ; then
    COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) $(compgen -d -- ${cur}))

    elif [[ $COMP_CWORD -ge 2 ]] ; then
    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
    fi
    return 0
} &&
complete -o filenames -F _ebuild ebuild

# vim: ft=sh:et:ts=4:sw=4:tw=80