summaryrefslogtreecommitdiffstats
path: root/completions/sitecopy
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
commitf2621414ee5f2f601424c22f00e207903e3b6104 (patch)
tree56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/sitecopy
parentAdding debian version 1:2.11-8. (diff)
downloadbash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz
bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/sitecopy')
-rw-r--r--completions/sitecopy30
1 files changed, 16 insertions, 14 deletions
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 <raphael.droz+floss@gmail.com>
# 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