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/sitecopy | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'completions/sitecopy') diff --git a/completions/sitecopy b/completions/sitecopy index 8515687..87e8775 100644 --- a/completions/sitecopy +++ b/completions/sitecopy @@ -3,31 +3,33 @@ # 2011 Raphaƫl Droz # License: GNU GPL v2 or later -_sitecopy() +_comp_cmd_sitecopy() { - local cur prev words cword split - _init_completion -s || return + local cur prev words cword was_split comp_args + _comp_initialize -s -- "$@" || return + local noargopts='!(-*|*[dgrp]*)' + # shellcheck disable=SC2254 case $prev in - --debug | -!(-*)d) - COMPREPLY=($(compgen -W "socket files rcfile ftp http httpbody - rsh sftp xml xmlparse cleartext" -- "$cur")) + --debug | -${noargopts}d) + _comp_compgen -- -W 'socket files rcfile ftp http httpbody rsh sftp + xml xmlparse cleartext' compopt -o nospace return ;; - --logfile | --rcfile | -!(-*)[gr]) - _filedir + --logfile | --rcfile | -${noargopts}[gr]) + _comp_compgen_filedir return ;; - --storepath | -!(-*)p) - _filedir -d + --storepath | -${noargopts}p) + _comp_compgen_filedir -d return ;; esac case $cur in --*) - COMPREPLY=($(compgen -W "$(_parse_help $1)" -- "$cur")) + _comp_compgen_help [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; @@ -41,10 +43,10 @@ _sitecopy() esac if [[ -r ~/.sitecopyrc ]]; then - COMPREPLY=($(compgen -W "$($1 -v | - command sed -n '/^Site:/s/Site: //p')" -- "$cur")) + _comp_compgen_split -- "$("$1" -v | + command sed -n '/^Site:/s/Site: //p')" fi } && - complete -F _sitecopy -o default sitecopy + complete -F _comp_cmd_sitecopy -o default sitecopy # ex: filetype=sh -- cgit v1.2.3