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

#
# browser-config completion command
#
_browserconfig()
{
    local cur prev
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ ${COMP_CWORD} -eq 1 ]]; then
    COMPREPLY=($(compgen -W '-b -h -m' -- ${cur}))
    elif [[ "${prev}" == "-b" ]]; then
    COMPREPLY=($(compgen -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/usr/share/browser-config/*; do [ -f $i ] && echo ${i##*/}; done)" $cur))
    elif [[ "${prev}" == "-m" ]]; then
        COMPREPLY=($(compgen -W "same_window new_window new_tab new_browser" -- ${cur}))
    if [[ -z "${COMPREPLY}" ]]; then
        COMPREPLY=''
    fi
    else
    unset COMPREPLY
    fi
    return 0
} &&
complete -F _browserconfig browser-config

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