PageRenderTime 87ms CodeModel.GetById 86ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion.d/links

http://github.com/brinkman83/bashrc
#! | 43 lines | 38 code | 5 blank | 0 comment | 0 complexity | bef896ea47756b137e43ccfdcea4fe25 MD5 | raw file
 1# bash completion for links
 2
 3have links &&
 4_links()
 5{
 6    local cur
 7
 8    COMPREPLY=()
 9    cur=`_get_cword`
10
11    case "$cur" in
12        --*)
13            COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
14            ;;
15        -*)
16            COMPREPLY=( $( compgen -W '-async-dns -max-connections \
17                -max-connections-to-host -retries -receive-timeout \
18                -unrestartable-receive-timeout -format-cache-size \
19                -memory-cache-size -http-proxy -ftp-proxy -download-dir \
20                -assume-codepage -anonymous -dump -no-connect \
21                -source -version -help' -- "$cur" ) )
22                ;;
23        *)
24            if [ -r ~/.links/links.his ]; then
25                COMPREPLY=( $( compgen -W '$( < ~/.links/links.his )' \
26                    -- "$cur" ) )
27            fi
28            _filedir '@(htm|html)'
29            return 0
30            ;;
31    esac
32
33    return 0
34} &&
35complete -F _links $filenames links
36
37# Local variables:
38# mode: shell-script
39# sh-basic-offset: 4
40# sh-indent-comment: t
41# indent-tabs-mode: nil
42# End:
43# ex: ts=4 sw=4 et filetype=sh