597 lines
11 KiB
Plaintext
Raw Normal View History

# Mailman completion by Guillaume Rousse <rousse@ccr.jussieu.fr>
2009-01-14 22:24:51 +02:00
2009-06-12 20:24:00 +03:00
have list_lists && {
_mailman_lists()
{
2009-10-04 19:42:50 +02:00
COMPREPLY=( $( compgen -W '$( list_lists -b )' -- "$cur" ) )
}
2009-06-12 20:24:00 +03:00
_list_lists()
{
2009-10-04 19:42:50 +02:00
local cur
2009-06-12 20:24:00 +03:00
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-06-12 20:24:00 +03:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \
--bare --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _list_lists list_lists
}
have add_members &&
_add_members()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true
case "$prev" in
-@(r|d|-regular-members-file|-digest-members-file))
_filedir
return 0
;;
-@(w|a|-welcome-msg|-admin-notify))
COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--regular-members-file \
--digest-members-file --welcome-msg \
--admin-notify --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _add_members add_members
2009-06-12 20:24:00 +03:00
have remove_members &&
_remove_members()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-10-04 19:42:50 +02:00
_split_longopt && split=true
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
case "$prev" in
-@(f|-file))
_filedir
return 0
;;
esac
2009-10-04 19:42:50 +02:00
$split && return 0
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack \
--noadminack --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _remove_members remove_members
2009-06-12 20:24:00 +03:00
have find_member &&
_find_member()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-10-04 19:42:50 +02:00
_split_longopt && split=true
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
case "$prev" in
-@(l|x|-listname|-exclude))
_mailman_lists
return 0
;;
esac
2009-10-04 19:42:50 +02:00
$split && return 0
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--listname --exclude --owners \
--help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _find_member find_member
2009-06-12 20:24:00 +03:00
have clone_member &&
_clone_member()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-10-04 19:42:50 +02:00
_split_longopt && split=true
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
case "$prev" in
-@(l|-listname))
_mailman_lists
return 0
;;
esac
2009-10-04 19:42:50 +02:00
$split && return 0
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--listname --remove --admin \
--quiet --nomodify --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _clone_member clone_member
2009-06-12 20:24:00 +03:00
have sync_members &&
_sync_members()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true
case "$prev" in
-@(w|g|d|--welcome-msg|-goodbye-msg|-digest))
COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0
;;
-@(d|-file))
_filedir
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--no-change --welcome-msg \
--goodbye-msg --digest --notifyadmin --file --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _sync_members sync_members
2009-06-12 20:24:00 +03:00
have unshunt &&
_unshunt()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_filedir -d
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _unshunt unshunt
2009-06-12 20:24:00 +03:00
have list_admins &&
_list_admins()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _list_admins list_admins
2009-06-12 20:24:00 +03:00
have list_owners &&
_list_owners()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--with-listnames --moderators \
2009-10-04 19:42:50 +02:00
--help' -- "$cur" ) )
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _list_owners list_owners
2009-06-12 20:24:00 +03:00
have list_members &&
_list_members()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true
case "$prev" in
-@(o|-output))
_filedir
return 0
;;
-@(d|-digest))
COMPREPLY=( $( compgen -W 'mime plain' -- "$cur") )
return 0
;;
-@(n|-nomail))
COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \
-- "$cur") )
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--output --regular --digest \
--nomail --fullnames --preserve --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _list_members list_members
2009-06-12 20:24:00 +03:00
have change_pw &&
_change_pw()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-10-04 19:42:50 +02:00
_split_longopt && split=true
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
case "$prev" in
-@(l|-listname))
_mailman_lists
return 0
;;
esac
2009-10-04 19:42:50 +02:00
$split && return 0
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all --domain --listname \
--password --quiet --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _change_pw change_pw
2009-06-12 20:24:00 +03:00
have withlist &&
_withlist()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--lock --interactive \
--run --all --quiet --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _withlist withlist
2009-06-12 20:24:00 +03:00
have newlist &&
_newlist()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--language --quiet --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _newlist newlist
2009-06-12 20:24:00 +03:00
have rmlist &&
_rmlist()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _rmlist rmlist
2009-06-12 20:24:00 +03:00
have config_list &&
_config_list()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
_split_longopt && split=true
2009-10-04 19:42:50 +02:00
case "$prev" in
-@(i|o|-inputfile|-outputfile))
_filedir
return 0
;;
esac
2009-10-04 19:42:50 +02:00
$split && return 0
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--inputfile --outputfile \
--checkonly --verbose --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _config_list -o filenames config_list
2009-06-12 20:24:00 +03:00
have arch &&
_arch()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true
case "$prev" in
-@(w|g|d|--welcome-msg|-goodbye-msg|-digest))
COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0
;;
-@(d|-file))
_filedir
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--wipe --start --end --quiet \
2009-10-04 19:42:50 +02:00
--help' -- "$cur" ) )
else
args=$COMP_CWORD
for (( i=1; i < COMP_CWORD; i++ )); do
if [[ "${COMP_WORDS[i]}" == -* ]]; then
args=$(($args-1))
fi
done
case $args in
1)
_mailman_lists
;;
2)
_filedir
;;
esac
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _arch -o filenames arch
2009-06-12 20:24:00 +03:00
have cleanarch &&
_cleanarch()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--status --dry-run --quiet \
2009-10-04 19:42:50 +02:00
--help' -- "$cur" ) )
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _cleanarch cleanarch
2009-06-12 20:24:00 +03:00
have inject &&
_inject()
{
2009-10-04 19:42:50 +02:00
local cur prev split=false
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-10-04 19:42:50 +02:00
_split_longopt && split=true
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
case "$prev" in
-@(l|-listname))
_mailman_lists
return 0
;;
esac
2009-10-04 19:42:50 +02:00
$split && return 0
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--listname --queue --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_filedir
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _inject -o filenames inject
2009-06-12 20:24:00 +03:00
have dumpdb &&
_dumpdb()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \
2009-10-04 19:42:50 +02:00
--help' -- "$cur" ) )
else
_filedir
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _dumpdb -o filenames dumpdb
2009-06-12 20:24:00 +03:00
have check_db &&
_check_db()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
_mailman_lists
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _check_db check_db
2009-06-12 20:24:00 +03:00
have check_perms &&
_check_perms()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) )
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _check_perms check_perms
2009-06-12 20:24:00 +03:00
have genaliases &&
_genaliases()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _genaliases genaliases
2009-06-12 20:24:00 +03:00
have mmsitepass &&
_mmsitepass()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _mmsitepass mmsitepass
2009-06-12 20:24:00 +03:00
have qrunner &&
_qrunner()
{
2009-10-04 19:42:50 +02:00
local cur prev
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-06-12 20:26:54 +03:00
2009-10-04 19:42:50 +02:00
_split_longopt && return 0
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--runner --once \
--list --verbose --subproc --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _qrunner qrunner
2009-06-12 20:24:00 +03:00
have mailmanctl &&
_mailmanctl()
{
2009-10-04 19:42:50 +02:00
local cur
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--no-restart --run-as-user \
--stale-lock-cleanup --quiet --help' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
else
COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) )
fi
2009-06-12 20:24:00 +03:00
} &&
complete -F _mailmanctl mailmanctl
# 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