[Bash-completion-devel] completion for ipv6calc

Adrian Friedli adi at koalatux.ch
Sun Jan 3 02:56:05 UTC 2010


Hallo

I just wrote a simple completion for ipv6calc. I could not find the to_review 
directory in the git repository and I don't think I've got commit access, so I 
post it here.

Please CC me, because I'm not on this list.

Cheers, Adi

PS: The email address in the irc channel topic is wrong.
-------------- next part --------------
have ipv6calc &&
_ipv6calc()
{
    local cur prev

    COMPREPLY=()
    cur=`_get_cword`
    prev=${COMP_WORDS[COMP_CWORD-1]}

    case "$prev" in
        -I|--in)
            COMPREPLY=( $( compgen -W 'auto revnibbles.int \
                revnibbles.arpa bitstring ipv6addr ipv4addr mac \
                base85 ifinet6 iid+token ipv6logconv prefix+mac' \
                -- "$cur" ) )
            return 0
            ;;
        -O|--out)
            COMPREPLY=( $( compgen -W 'revnibbles.int \
                revnibbles.arpa bitstring ipv6addr ipv4addr mac \
                eui64 base85 ifinet6 iid iid+token addrtype \
                ouitype ipv6addrtype any revipv4' -- "$cur" ) )
            return 0
            ;;
        -A|--action)
            COMPREPLY=( $( compgen -W 'auto geneui64 conv6to4 \
                genprivacyiid prefixmac2ipv6' -- "$cur" ) )
            return 0
            ;;
    esac

    COMPREPLY=( $( compgen -W '--help --quiet --in --out --action \
        --examples --showinfo --lowercase --uppercase \
        --printprefix --printsuffix --maskprefix --masksuffix \
        --printcompressed --printuncompressed \
        --printfulluncompressed' -- "$cur" ) )
    return 0
}
complete -F _ipv6calc ipv6calc

# ex: ts=4 sw=4 et filetype=sh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20100103/f6e796f9/attachment.pgp>


More information about the Bash-completion-devel mailing list