summaryrefslogtreecommitdiffstats
path: root/completions/add_members
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf4acb49ea148cdd899f7f29f1591c7bc853c2135 (patch)
treeb62d60873864065d6428a84a119dd8a3c90f1397 /completions/add_members
parentAdding upstream version 1:2.11. (diff)
downloadbash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.tar.xz
bash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.zip
Adding upstream version 1:2.12.0.upstream/1%2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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