fish-shell/share/functions/__fish_complete_groups.fish

13 lines
389 B
Fish
Raw Normal View History

function __fish_complete_groups --description "Print a list of local groups, with group members as the description"
if command -sq getent
2020-04-18 13:58:07 +08:00
getent group | while read -l line
string split -f 1,4 : -- $line | string join \t
end
else
2020-04-18 13:58:07 +08:00
while read -l line
string split -f 1,4 : -- $line | string join \t
end </etc/group
end
end