summaryrefslogtreecommitdiffstats
path: root/completions/sync_members
diff options
context:
space:
mode:
Diffstat (limited to 'completions/sync_members')
-rw-r--r--completions/sync_members23
1 files changed, 13 insertions, 10 deletions
diff --git a/completions/sync_members b/completions/sync_members
index 397f8b0..e8c07a7 100644
--- a/completions/sync_members
+++ b/completions/sync_members
@@ -1,31 +1,34 @@
# mailman sync_members completion -*- shell-script -*-
-_sync_members()
+_comp_cmd_sync_members()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
case $prev in
-w | -g | -d | --welcome-msg | --goodbye-msg | --digest)
- COMPREPLY=($(compgen -W 'y n' -- "$cur"))
+ _comp_compgen -- -W 'y n'
return
;;
--file)
- _filedir
+ _comp_compgen_filedir
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '--no-change --welcome-msg --goodbye-msg
- --digest --notifyadmin --file --help' -- "$cur"))
+ _comp_compgen -- -W '--no-change --welcome-msg --goodbye-msg --digest
+ --notifyadmin --file --help'
else
- _xfunc list_lists _mailman_lists
+ # Prefer `list_lists` in the same dir as command
+ local pathcmd
+ pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
+ _comp_compgen -x list_lists mailman_lists
fi
} &&
- complete -F _sync_members sync_members
+ complete -F _comp_cmd_sync_members sync_members
# ex: filetype=sh