about summary refs log tree commit diff
path: root/Completion/User/_groups
blob: b867634c0b38d45b45d48eebd45fde1bb6d72370 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#compdef newgrp

local expl

if (( ! $+groups )); then
  if whence -p ypcat > /dev/null; then
    : ${(A)groups:=${${(s: :)$(ypcat group.byname)}%%:*}} # If you use NIS
  else
    : ${(A)groups:=${${(s: :)$(</etc/group)}%%:*}}
  fi
fi

_description expl group
compadd "$@" "$expl[@]" - $groups