diff options
Diffstat (limited to 'completions/rmlist')
-rw-r--r-- | completions/rmlist | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/completions/rmlist b/completions/rmlist index 0cc473a..f3aca06 100644 --- a/completions/rmlist +++ b/completions/rmlist @@ -1,17 +1,20 @@ # mailman rmlist completion -*- shell-script -*- -_rmlist() +_comp_cmd_rmlist() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--archives --help' -- "$cur")) + _comp_compgen -- -W '--archives --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 _rmlist rmlist + complete -F _comp_cmd_rmlist rmlist # ex: filetype=sh |