[Bash-completion-devel] completion for ipv6calc

gibboris at gmail.com gibboris at gmail.com
Sun Jan 3 09:14:26 UTC 2010


On Sun, Jan 03, 2010 at 03:56:05AM +0100, Adrian Friedli wrote:
> Hallo
Hi,
> 
> 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.

> have ipv6calc &&
> _ipv6calc()
> {
>     local cur prev
> 
>     COMPREPLY=()
>     cur=`_get_cword`
>     prev=${COMP_WORDS[COMP_CWORD-1]}
there is a new _get_pword.

> 
>     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" ) )
doesn't long_opt work for ipv6calc ?
(from a quick look, I didn't install it)

>     return 0
> }
> complete -F _ipv6calc ipv6calc
> 
> # ex: ts=4 sw=4 et filetype=sh

Have a good day.

Raph



More information about the Bash-completion-devel mailing list