summaryrefslogtreecommitdiffstats
path: root/completions/chown
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/chown
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 '')
-rw-r--r--completions/chown32
1 files changed, 16 insertions, 16 deletions
diff --git a/completions/chown b/completions/chown
index 1d746b7..25d0d67 100644
--- a/completions/chown
+++ b/completions/chown
@@ -1,46 +1,46 @@
# chown(1) completion -*- shell-script -*-
-_chown()
+_comp_cmd_chown()
{
- local cur prev words cword split
+ local cur prev words cword was_split comp_args
# Don't treat user:group as separate words.
- _init_completion -s -n : || return
+ _comp_initialize -s -n : -- "$@" || return
case "$prev" in
--from)
- _usergroup
+ _comp_compgen_usergroups
return
;;
--reference)
- _filedir
+ _comp_compgen_filedir
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
# Complete -options
- local w opts
+ local w opts=""
for w in "${words[@]}"; do
[[ $w == -@(R|-recursive) ]] && opts="-H -L -P" && break
done
- COMPREPLY=($(compgen -W '-c -h -f -R -v --changes --dereference
+ _comp_compgen -- -W '-c -h -f -R -v --changes --dereference
--no-dereference --from --silent --quiet --reference --recursive
- --verbose --help --version $opts' -- "$cur"))
+ --verbose --help --version $opts'
else
- local args
+ local REPLY
- # The first argument is an usergroup; the rest are filedir.
- _count_args :
+ # The first argument is a usergroup; the rest are filedir.
+ _comp_count_args
- if ((args == 1)); then
- _usergroup -u
+ if ((REPLY == 1)); then
+ _comp_compgen_usergroups -u
else
- _filedir
+ _comp_compgen_filedir
fi
fi
} &&
- complete -F _chown chown
+ complete -F _comp_cmd_chown chown
# ex: filetype=sh