summaryrefslogtreecommitdiffstats
path: root/completions/chown
diff options
context:
space:
mode:
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