fish-shell/share/functions/__fish_complete_groups.fish
Fabian Homborg 0a8c922d92 Use command -sq instead of redirection
This option has been available for a while now and it's a bit shorter.
2017-02-18 22:16:55 +01:00

9 lines
274 B
Fish

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