summaryrefslogtreecommitdiffstats
path: root/completions/sh
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/sh
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/sh')
-rw-r--r--completions/sh25
1 files changed, 12 insertions, 13 deletions
diff --git a/completions/sh b/completions/sh
index 5624ffa..5581bcc 100644
--- a/completions/sh
+++ b/completions/sh
@@ -1,36 +1,35 @@
# POSIX sh(1) completion -*- shell-script -*-
-_sh()
+_comp_cmd_sh()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
case $prev in
-c)
return
;;
-o | +o)
- COMPREPLY=($(compgen -W 'allexport errexit ignoreeof monitor
- noclobber noglob noexec nolog notify nounset verbose vi
- xtrace' -- "$cur"))
+ _comp_compgen -- -W 'allexport errexit ignoreeof monitor noclobber
+ noglob noexec nolog notify nounset verbose vi xtrace'
return
;;
esac
local opts="-a -b -C -e -f -h -i -m -n -o -u -v -x"
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W "$opts -c -s" -- "$cur"))
+ _comp_compgen -- -W "$opts -c -s"
return
elif [[ $cur == +* ]]; then
- COMPREPLY=($(compgen -W "${opts//-/+}" -- "$cur"))
+ _comp_compgen -- -W "${opts//-/+}"
return
fi
- local args ext=
- _count_args "" "@(-c|[-+]o)"
- ((args == 1)) && ext="sh"
- _filedir $ext
+ local REPLY ext=
+ _comp_count_args -a "@(-c|[-+]o)"
+ ((REPLY == 1)) && ext="sh"
+ _comp_compgen_filedir $ext
} &&
- complete -F _sh sh
+ complete -F _comp_cmd_sh sh
# ex: filetype=sh