fish-shell/share/functions/__fish_complete_groups.fish

8 lines
263 B
Fish

function __fish_complete_groups --description "Print a list of local groups, with group members as the description"
if command -s getent >/dev/null
getent group | cut -d ':' -f 1,4 | sed 's/:/\t/'
else
cut -d ':' -f 1,4 /etc/group | sed 's/:/\t/'
end
end