51 lines
1.4 KiB
Plaintext
Raw Normal View History

2009-05-18 23:03:07 +02:00
# bash completion for msynctool
have msynctool || return
2009-05-18 23:03:07 +02:00
_msynctool()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:07 +02: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
--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
;;
--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
# Local variables:
# mode: shell-script
2009-10-04 19:42:50 +02:00
# sh-basic-offset: 4
# sh-indent-comment: t
2009-10-04 19:42:50 +02:00
# indent-tabs-mode: nil
# End:
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh