# 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