Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
59 - 1
# iconv(1) completion
2
 
3
have iconv &&
4
_iconv()
5
{
6
    local cur prev split=false
7
 
8
    COMPREPLY=()
9
    _get_comp_words_by_ref cur prev
10
 
11
    _split_longopt && split=true
12
 
13
    case $prev in
14
        -'?'|--help|--usage|-V|--version|--unicode-subst|--byte-subst|\
15
        --widechar-subst)
16
            return 0
17
            ;;
18
        -f|--from-code|-t|--to-code)
19
            COMPREPLY=( $( compgen -W '$( iconv -l | \
20
                sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) )
21
            return 0
22
            ;;
23
        -o|--output)
24
            _filedir
25
            return 0
26
            ;;
27
    esac
28
 
29
    $split && return 0
30
 
31
    if [[ "$cur" = -* ]]; then
32
        COMPREPLY=( $( compgen -W '--from-code --to-code --list -c
33
            --unicode-subst --byte-subst --widechar-subst --output --silent
34
            --verbose --help --usage --version' -- "$cur" ) )
35
        return 0
36
    fi
37
} &&
38
complete -F _iconv -o default iconv
39
 
40
# Local variables:
41
# mode: shell-script
42
# sh-basic-offset: 4
43
# sh-indent-comment: t
44
# indent-tabs-mode: nil
45
# End:
46
# ex: ts=4 sw=4 et filetype=sh