~ubuntu-branches/debian/experimental/bash-completion/experimental

« back to all changes in this revision

Viewing changes to contrib/iconv

  • Committer: Bazaar Package Importer
  • Author(s): David Paleino
  • Date: 2009-11-14 23:42:55 UTC
  • mfrom: (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091114234255-pfxxt8bobqbq9hqq
Tags: 1:1.1-3
debian/patches/03-fix_552631.patch fixed (Closes: #556251)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# iconv(1) completion
 
2
 
 
3
have iconv &&
 
4
_iconv()
 
5
{
 
6
    local cur prev
 
7
 
 
8
    COMPREPLY=()
 
9
    cur=`_get_cword`
 
10
    prev=${COMP_WORDS[COMP_CWORD-1]}
 
11
 
 
12
    case "$prev" in
 
13
        -@(f|t|-@(from|to)-code))
 
14
            COMPREPLY=( $( compgen -W \
 
15
                '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) )
 
16
            return 0
 
17
            ;;
 
18
    esac
 
19
 
 
20
 
 
21
    if [[ "$cur" = -* ]]; then
 
22
        COMPREPLY=( $( compgen -W '--from-code -f --to-code -t --list
 
23
            --output -o --verbose' -- "$cur" ) )
 
24
        return 0
 
25
    fi
 
26
} &&
 
27
complete -F _iconv $default iconv
 
28
 
 
29
# Local variables:
 
30
# mode: shell-script
 
31
# sh-basic-offset: 4
 
32
# sh-indent-comment: t
 
33
# indent-tabs-mode: nil
 
34
# End:
 
35
# ex: ts=4 sw=4 et filetype=sh