2009-05-18 23:03:07 +02:00
|
|
|
# bash completion for msynctool
|
|
|
|
|
2011-04-05 00:35:51 +03:00
|
|
|
have msynctool || return
|
|
|
|
|
2009-05-18 23:03:07 +02:00
|
|
|
_msynctool()
|
|
|
|
{
|
2011-04-20 22:42:55 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2009-05-18 23:03:07 +02:00
|
|
|
|
2011-04-20 22:42:55 +03:00
|
|
|
case $words in
|
2009-10-04 19:42:50 +02:00
|
|
|
--configure)
|
|
|
|
COMPREPLY=( $( compgen -W "$(msynctool --showgroup \
|
|
|
|
$prev | awk '/^Member/ {print $2}' | sed \
|
|
|
|
-e 's/:$//' )" -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--addmember)
|
|
|
|
COMPREPLY=( $( compgen -W '$(msynctool --listplugins \
|
|
|
|
| sed -e '1d' )' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
2009-05-18 23:03:07 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
case $prev in
|
2009-11-22 11:43:26 +01:00
|
|
|
--configure|--addgroup|--delgroup|--showgroup|--sync|--addmember)
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -W '$(msynctool --listgroups \
|
|
|
|
| sed -e '1d' )' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
2009-11-22 11:43:26 +01:00
|
|
|
--showformats|--filter-objtype|--slow-sync)
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -W '$(msynctool --listobjects \
|
|
|
|
| sed -e '1d' )' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
2009-05-18 23:03:07 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -W '--listgroups --listplugins --listobjects \
|
|
|
|
--showformats --showgroup --sync --filter-objtype --slow-sync \
|
|
|
|
--wait --multi --addgroup --delgroup --addmember --configure \
|
|
|
|
--manual --configdir --conflict' -- "$cur" ) )
|
2009-05-18 23:03:07 +02:00
|
|
|
} &&
|
|
|
|
complete -F _msynctool msynctool
|
2009-10-01 20:54:51 +03:00
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
2009-10-04 19:42:50 +02:00
|
|
|
# sh-basic-offset: 4
|
2009-10-01 20:54:51 +03:00
|
|
|
# sh-indent-comment: t
|
2009-10-04 19:42:50 +02:00
|
|
|
# indent-tabs-mode: nil
|
2009-10-01 20:54:51 +03:00
|
|
|
# End:
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|