summaryrefslogtreecommitdiffstats
path: root/completions/add_members
diff options
context:
space:
mode:
Diffstat (limited to 'completions/add_members')
-rw-r--r--completions/add_members23
1 files changed, 13 insertions, 10 deletions
diff --git a/completions/add_members b/completions/add_members
index efa4f1e..d691884 100644
--- a/completions/add_members
+++ b/completions/add_members
@@ -1,31 +1,34 @@
# mailman add_members completion -*- shell-script -*-
-_add_members()
+_comp_cmd_add_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
-r | -d | --regular-members-file | --digest-members-file)
- _filedir
+ _comp_compgen_filedir
return
;;
-w | -a | --welcome-msg | --admin-notify)
- COMPREPLY=($(compgen -W 'y n' -- "$cur"))
+ _comp_compgen -- -W 'y n'
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '--regular-members-file --digest-members-file
- --welcome-msg --admin-notify --help' -- "$cur"))
+ _comp_compgen -- -W '--regular-members-file --digest-members-file
+ --welcome-msg --admin-notify --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_xfunc list_lists mailman_lists
fi
} &&
- complete -F _add_members add_members
+ complete -F _comp_cmd_add_members add_members
# ex: filetype=sh