[Bash-completion-devel] completion for ipv6calc
Adrian Friedli
adi at koalatux.ch
Sun Jan 3 12:54:04 UTC 2010
Hallo
On Sunday 03 January 2010 10:14:26 gibboris at gmail.com wrote:
> there is a new _get_pword.
OK.
> doesn't long_opt work for ipv6calc ?
> (from a quick look, I didn't install it)
Indeed. I added _split_longopt.
Cheers, Adi
-------------- next part --------------
have ipv6calc &&
_ipv6calc()
{
local cur prev split=false
COMPREPLY=()
cur=`_get_cword =`
prev=`_get_pword`
_split_longopt && split=true
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
$split && return 0
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
More information about the Bash-completion-devel
mailing list