From f2621414ee5f2f601424c22f00e207903e3b6104 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 03:03:18 +0200 Subject: Merging upstream version 1:2.12.0. Signed-off-by: Daniel Baumann --- completions/newlist | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'completions/newlist') diff --git a/completions/newlist b/completions/newlist index f1f6cf8..b4e6060 100644 --- a/completions/newlist +++ b/completions/newlist @@ -1,9 +1,9 @@ # mailman newlist completion -*- shell-script -*- -_newlist() +_comp_cmd_newlist() { - 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 -l | --language | -u | --urlhost | -e | --emailhost | --help) @@ -11,15 +11,18 @@ _newlist() ;; esac - $split && return + [[ $was_split ]] && return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + _comp_compgen_help [[ ${COMPREPLY-} == *= ]] && compopt -o nospace 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 _newlist newlist + complete -F _comp_cmd_newlist newlist # ex: filetype=sh -- cgit v1.2.3