about summary refs log tree commit diff
path: root/Completion/User/_chown
blob: 0363e838c63175ec67a0a8641c3be43aab616879 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#compdef chown chgrp

local suf

if [[ CURRENT -eq 2 || CURRENT -eq 3 && $words[CURRENT-1] = -* ]]; then
  if [[ ${words[1]:t} = chgrp ]] || compset -P '*[:.]'; then
    _groups
  else
    if [[ $OSTYPE = (solaris*|hpux*) ]]; then
      suf=':'
    else
      suf='.'
    fi
    compset -S '.*' && unset suf
    _users -S "$suf" -q
  fi
else
  _files
fi